'Tests queries using index fields for object models using db_field mapping
@since 3.1
@jira_ticket PYTHON-351
@expected_result results are properly retrieved without errors
@test_category object_mapper'

@execute_count(15)
def test_index(self):

    for model in self.model_list:
        values = {'k0': 1, 'k1': 5, 'c0': 3, 'v0': 4, 'v1': 5}
        clustering_values = range(3)
        for c in clustering_values:
            values['c0'] = c
            values['v1'] = c
            i = model.create(**values)
        self.assertEqual(model.objects(k0=i.k0, k1=i.k1).count(), len(clustering_values))
        self.assertEqual(model.objects(k0=i.k0, k1=i.k1, v1=0).count(), 1)
