diff --git a/neutron/tests/unit/objects/db/test_api.py b/neutron/tests/unit/objects/db/test_api.py index beef8bc1f1f..da91546b30e 100644 --- a/neutron/tests/unit/objects/db/test_api.py +++ b/neutron/tests/unit/objects/db/test_api.py @@ -25,9 +25,6 @@ from neutron.tests import base as test_base from neutron.tests.unit import testlib_api -PLUGIN_NAME = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' - - class FakeModel(object): def __init__(self, *args, **kwargs): pass @@ -39,12 +36,6 @@ class FakeObj(base.NeutronDbObject): class GetObjectsTestCase(test_base.BaseTestCase): - def setUp(self): - super(GetObjectsTestCase, self).setUp() - # TODO(ihrachys): revisit plugin setup once we decouple - # objects.db.objects.api from core plugin instance - self.setup_coreplugin(PLUGIN_NAME) - def test_get_objects_pass_marker_obj_when_limit_and_marker_passed(self): ctxt = context.get_admin_context() marker = mock.sentinel.marker diff --git a/neutron/tests/unit/objects/test_base.py b/neutron/tests/unit/objects/test_base.py index 821b7f3d839..68498161a87 100644 --- a/neutron/tests/unit/objects/test_base.py +++ b/neutron/tests/unit/objects/test_base.py @@ -559,13 +559,8 @@ class _BaseObjectTestCase(object): _test_class = FakeNeutronDbObject - CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' - def setUp(self): super(_BaseObjectTestCase, self).setUp() - # TODO(ihrachys): revisit plugin setup once we decouple - # neutron.objects.db.api from core plugin instance - self.setup_coreplugin(self.CORE_PLUGIN) # make sure all objects are loaded and registered in the registry objects.register_objects() self.context = context.get_admin_context() diff --git a/neutron/tests/unit/objects/test_subnet.py b/neutron/tests/unit/objects/test_subnet.py index 2ace9cd6293..f3561705e53 100644 --- a/neutron/tests/unit/objects/test_subnet.py +++ b/neutron/tests/unit/objects/test_subnet.py @@ -148,8 +148,13 @@ class SubnetDbObjectTestCase(obj_test_base.BaseDbObjectTestCase, _test_class = subnet.Subnet + CORE_PLUGIN = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' + def setUp(self): super(SubnetDbObjectTestCase, self).setUp() + # set up plugin because some models used here require a plugin + # (specifically, rbac models and their get_valid_actions validators) + self.setup_coreplugin(self.CORE_PLUGIN) network_id = self._create_test_network_id() self.update_obj_fields( {'network_id': network_id,