#NEWLINE# def test_model_delete_async( self ) : #NEWLINE# #INDENT# self . __setup ( as_testModel ) #NEWLINE# more_other_data = { #NEWLINE# #INDENT# 'title' : 'moar titles plz' , #NEWLINE# 'date_published' : datetime ( 2012 , 2 , 2 , 1 , 1 , 1 ) , #NEWLINE# 'published' : True , #NEWLINE# 'integer_field' : 42 , #NEWLINE# 'float_field' : 3.14 , #NEWLINE# 'list_field' : [ sm1 , sm2 ] , #NEWLINE# #UNINDENT# } #NEWLINE# as_testModel ( more_other_data ) . save_async ( callback = self . stop ) #NEWLINE# as_testModel . find_one_async ( { #NEWLINE# #INDENT# 'title' : 'moar titles plz' , #NEWLINE# #UNINDENT# } , callback = self . stop ) #NEWLINE# import time #NEWLINE# time . sleep ( 1 ) #NEWLINE# newfoundValue = self . wait ( ) #NEWLINE# self . assertEqual ( newfoundValue . title , more_other_data [ 'title' ] ) #NEWLINE# self . assertNotEqual ( newfoundValue . _id , None ) #NEWLINE# if newfoundValue : #NEWLINE# #INDENT# newfoundValue . delete_async ( callback = self . stop ) #NEWLINE# ignore = self . wait ( ) #NEWLINE# #UNINDENT# as_testModel . find_one_async ( { #NEWLINE# #INDENT# 'title' : 'moar titles plz' , #NEWLINE# #UNINDENT# } , callback = self . stop ) #NEWLINE# not_found = self . wait ( ) #NEWLINE# self . assertEqual ( not_found , None )