#NEWLINE# def test__ordered_insert_find( self ) : #NEWLINE# #INDENT# 'Tests ordered inserts\n\n        If we insert values 1, 2, 3 and find them, we must see them in order as\n        we inserted them.\n        ' #NEWLINE# values = list ( range ( 20 ) ) #NEWLINE# random . shuffle ( values ) #NEWLINE# for val in values : #NEWLINE# #INDENT# self . db . collection . insert ( { #NEWLINE# #INDENT# '_id' : val , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# find_cursor = self . db . collection . find ( ) #NEWLINE# for val in values : #NEWLINE# #INDENT# in_db_val = find_cursor . next ( ) #NEWLINE# expected = { #NEWLINE# #INDENT# '_id' : val , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( in_db_val , expected )