#NEWLINE# def test_that_readahead_stores_markers( self ) : #NEWLINE# #INDENT# paginator = Paginator ( TestUser . objects . all ( ) . order_by ( 'first_name' ) , 1 , readahead = 4 ) #NEWLINE# expected_markers = ( [ None ] + list ( TestUser . objects . all ( ) . order_by ( 'first_name' ) . values_list ( paginator . field_required , flat = True ) ) [ : 3 ] ) #NEWLINE# paginator . page ( 1 ) #NEWLINE# query_id = queryset_identifier ( self . object_list ) #NEWLINE# actual_markers = [ ] #NEWLINE# for i in xrange ( 1 , 5 ) : #NEWLINE# #INDENT# actual_markers . append ( _get_marker ( query_id , i ) [ 0 ] ) #NEWLINE# #UNINDENT# self . assertEqual ( expected_markers , actual_markers ) #NEWLINE# paginator = Paginator ( TestUser . objects . all ( ) . order_by ( 'first_name' ) , 2 , readahead = 4 ) #NEWLINE# all_markers = list ( TestUser . objects . all ( ) . order_by ( 'first_name' ) . values_list ( paginator . field_required , flat = True ) ) #NEWLINE# expected_markers = [ None , all_markers [ 1 ] ] #NEWLINE# paginator . page ( 1 ) #NEWLINE# query_id = queryset_identifier ( paginator . object_list ) #NEWLINE# actual_markers = [ ] #NEWLINE# for i in xrange ( 1 , 3 ) : #NEWLINE# #INDENT# actual_markers . append ( _get_marker ( query_id , i ) [ 0 ] ) #NEWLINE# #UNINDENT# self . assertEqual ( expected_markers , actual_markers )