#NEWLINE# def test_past_date( self ) : #NEWLINE# #INDENT# '\n        Ability to limit iterations to a user and a date in the past.\n        ' #NEWLINE# user = self . matt #NEWLINE# username = self . matt . username #NEWLINE# past_date = ( date . today ( ) - timedelta ( 5 ) ) #NEWLINE# pearl = mommy . make ( 'core.Pearl' , user = user ) #NEWLINE# mommy . make ( 'core.Iteration' , date = past_date , pearl = pearl ) #NEWLINE# mommy . make ( 'core.Iteration' , date = date . today ( ) , pearl = pearl ) #NEWLINE# mommy . make ( 'core.Iteration' , date = ( date . today ( ) + timedelta ( 5 ) ) , pearl = pearl ) #NEWLINE# url = reverse ( 'edition_day' , args = [ username , past_date . year , past_date . month , past_date . day ] ) #NEWLINE# request = self . factory . get ( url ) #NEWLINE# response = DayEditionView . as_view ( month_format = '%m' ) ( request , user = username , year = str ( past_date . year ) , month = str ( past_date . month ) , day = str ( past_date . day ) ) #NEWLINE# self . assertEqual ( list ( user . context_data [ 'iteration_list' ] ) , list ( Iteration . objects . filter ( date = past_date ) ) )