'Tests creation update and delete of object model queries that are using db_field mappings.
@since 3.1
@jira_ticket PYTHON-351
@expected_result results are properly retrieved without errors
@test_category object_mapper'

@execute_count(33)
def test_basic_crud(self):

    for model in self.model_list:
        values = {'k0': 1, 'k1': 2, 'c0': 3, 'v0': 4, 'v1': 5}
        i = model.create(**values)
        i = model.objects(k0=i.k0, k1=i.k1).first()
        self.assertEqual(i, model(**values))
        values['v0'] = 101
        i.update(v0=values['v0'])
        i = model.objects(k0=i.k0, k1=i.k1).first()
        self.assertEqual(i, model(**values))
        model.objects(k0=i.k0, k1=i.k1).delete()
        i = model.objects(k0=i.k0, k1=i.k1).first()
        self.assertIsNone(i)
        i = model.create(**values)
        i = model.objects(k0=i.k0, k1=i.k1).first()
        self.assertEqual(i, model(**values))
        i.delete()
        model.objects(k0=i.k0, k1=i.k1).delete()
        i = model.objects(k0=i.k0, k1=i.k1).first()
        self.assertIsNone(i)
