'Test that get_objects fetches data from database.'

def test_get_objects(self):

    with mock.patch.object(obj_db_api, 'get_objects', side_effect=self.fake_get_objects) as get_objects_mock:
        objs = self._test_class.get_objects(self.context)
        self.assertItemsEqual([get_obj_persistent_fields(obj) for obj in self.objs], [get_obj_persistent_fields(obj) for obj in objs])
    get_objects_mock.assert_any_call(self.context, self._test_class.db_model, _pager=self.pager_map[self._test_class.obj_name()])
