#NEWLINE# def test_year_view_allow_future( self ) : #NEWLINE# #INDENT# year = ( datetime . date . today ( ) . year + 1 ) #NEWLINE# b = Book . objects . create ( name = 'The New New Testement' , pages = 600 , pubdate = datetime . date ( year , 1 , 1 ) ) #NEWLINE# res = self . client . get ( ( '/dates/books/%s/' % year ) ) #NEWLINE# self . assertEqual ( res . status_code , 404 ) #NEWLINE# res = self . client . get ( ( '/dates/books/%s/allow_empty/' % year ) ) #NEWLINE# self . assertEqual ( res . status_code , 200 ) #NEWLINE# self . assertEqual ( list ( res . context [ 'book_list' ] ) , [ ] ) #NEWLINE# res = self . client . get ( ( '/dates/books/%s/allow_future/' % year ) ) #NEWLINE# self . assertEqual ( res . status_code , 200 ) #NEWLINE# self . assertEqual ( list ( res . context [ 'date_list' ] ) , [ datetime . datetime ( year , 1 , 1 ) ] )