#NEWLINE# def test_user_limited_today( self ) : #NEWLINE# #INDENT# '\n        Ability to limit iterations to a user and those which are active today.\n        ' #NEWLINE# user = self . matt #NEWLINE# username = self . matt . username #NEWLINE# pearl = mommy . make ( 'core.Pearl' , user = user ) #NEWLINE# iterations = [ mommy . make ( 'core.Iteration' , date = date . today ( ) , pearl = pearl ) ] #NEWLINE# mommy . make ( 'core.Iteration' , date = ( date . today ( ) - timedelta ( 5 ) ) , pearl = pearl ) #NEWLINE# mommy . make ( 'core.Iteration' , date = ( date . today ( ) + timedelta ( 5 ) ) , pearl = pearl ) #NEWLINE# url = reverse ( 'edition_today' , args = [ username ] ) #NEWLINE# request = self . factory . get ( url ) #NEWLINE# response = TodayEditionView . as_view ( ) ( request , user = username ) #NEWLINE# self . assertEqual ( list ( response . context_data [ 'iteration_list' ] ) , list ( iterations ) )