#NEWLINE# def test_paginate_list( self ) : #NEWLINE# #INDENT# paginator = Paginator ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] , 5 ) #NEWLINE# self . assertEqual ( 9 , paginator . count ) #NEWLINE# self . assertEqual ( 2 , paginator . num_pages ) #NEWLINE# self . assertEqual ( [ 1 , 2 ] , paginator . page_range ) #NEWLINE# p = paginator . page ( 1 ) #NEWLINE# self . assertEqual ( '<Page 1 of 2>' , unicode ( p ) ) #NEWLINE# self . assertEqual ( [ 1 , 2 , 3 , 4 , 5 ] , p . object_list ) #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 ( ) )