#NEWLINE# def test_first_page( self ) : #NEWLINE# #INDENT# paginator = Paginator ( Article . objects . all ( ) , 5 ) #NEWLINE# p = paginator . page ( 1 ) #NEWLINE# self . assertEqual ( '<Page 1 of 2>' , unicode ( p ) ) #NEWLINE# self . assertQuerysetEqual ( paginator . object_list , [ '<Article: Article 1>' , '<Article: Article 2>' , '<Article: Article 3>' , '<Article: Article 4>' , '<Article: Article 5>' ] ) #NEWLINE# self . assertTrue ( p . has_next ( ) ) #NEWLINE# self . assertFalse ( p . has_previous ( ) ) #NEWLINE# self . assertTrue ( p . has_other_pages ( ) ) #NEWLINE# self . assertEqual ( 2 , p . next_page_number ( ) ) #NEWLINE# self . assertEqual ( 0 , p . previous_page_number ( ) ) #NEWLINE# self . assertEqual ( 1 , p . start_index ( ) ) #NEWLINE# self . assertEqual ( 5 , p . end_index ( ) )