<s> from __future__ import absolute_import <EOL> from datetime import date <EOL> from django . test import TestCase <EOL> from . models import Article <EOL> class MethodsTests ( TestCase ) : <EOL> def test_custom_methods ( self ) : <EOL> a = Article . objects . create ( <EOL> headline = "<STR_LIT>" , pub_date = date ( <NUM_LIT> , <NUM_LIT:7> , <NUM_LIT> ) <EOL> ) <EOL> b = Article . objects . create ( <EOL> headline = "<STR_LIT>" , pub_date = date ( <NUM_LIT> , <NUM_LIT:7> , <NUM_LIT> ) <EOL> ) <EOL> self . assertFalse ( a . was_published_today ( ) ) <EOL> self . assertQuerysetEqual ( <EOL> a . articles_from_same_day_1 ( ) , [ <EOL> "<STR_LIT>" , <EOL> ] , <EOL> lambda a : a . headline , <EOL> ) <EOL> self . assertQuerysetEqual ( <EOL> a . articles_from_same_day_2 ( ) , [ <EOL> "<STR_LIT>" , <EOL> ] , <EOL> lambda a : a . headline <EOL> ) <EOL> self . assertQuerysetEqual ( <EOL> b . articles_from_same_day_1 ( ) , [ <EOL> "<STR_LIT>" , <EOL> ] , <EOL> lambda a : a . headline , <EOL> ) <EOL> self . assertQuerysetEqual ( <EOL> b . articles_from_same_day_2 ( ) , [ <EOL> "<STR_LIT>" , <EOL> ] , <EOL> lambda a : a . headline <EOL> ) </s>
