#NEWLINE# def test_cursor( self ) : #NEWLINE# #INDENT# results = list ( FieldsWithOptionsModel . objects . all ( ) ) #NEWLINE# cursor = None #NEWLINE# for item in results : #NEWLINE# #INDENT# query = FieldsWithOptionsModel . objects . all ( ) [ : 1 ] #NEWLINE# if ( cursor is not None ) : #NEWLINE# #INDENT# query = set_cursor ( query , cursor ) #NEWLINE# #UNINDENT# next = query [ 0 ] #NEWLINE# self . assertEqual ( next . pk , item . pk ) #NEWLINE# cursor = get_cursor ( query ) #NEWLINE# self . assertIsNotNone ( cursor ) #NEWLINE# #UNINDENT# query = set_cursor ( FieldsWithOptionsModel . objects . all ( ) , cursor ) #NEWLINE# self . assertEqual ( list ( query [ : 1 ] ) , [ ] )