#NEWLINE# def test_create( self ) : #NEWLINE# #INDENT# with mock . patch . object ( obj_db_api , 'create_object' , return_value = self . db_obj ) as create_mock : #NEWLINE# #INDENT# with mock . patch . object ( obj_db_api , 'get_objects' , side_effect = self . fake_get_objects ) : #NEWLINE# #INDENT# obj = self . _test_class ( self . context , ** create_mock . obj_fields [ 0 ] ) #NEWLINE# self . _check_equal ( obj , self . obj_fields [ 0 ] ) #NEWLINE# obj . create ( ) #NEWLINE# self . _check_equal ( obj , self . obj_fields [ 0 ] ) #NEWLINE# create_mock . assert_called_once_with ( self . context , self . _test_class . db_model , self . db_obj )