summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2018-03-31 21:12:25 +0900
committerAkihiro Motoki <amotoki@gmail.com>2018-04-20 03:34:51 +0000
commit58019a7411cfe499c3bacb91bc60d8438ef5c10e (patch)
treef19588bc1cb269022117a4b7d19a7a342661185d
parent41ef5a120c43cd819400175545de85cd3e313294 (diff)
Disable mox usage by default in test helper
- Add use_mox = True to tests which still depend on mox - Remove use_mox = False from all tests converted into mock - Update the warning messages - Replace 'S'-release with 'Stein' Part of blueprint mock-framework-in-unit-tests Change-Id: I208185e97b2de346304a09643a9cb3f1425a7683 Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
Notes
Notes (review): Code-Review+2: Radomir Dopieralski <openstack@sheep.art.pl> Code-Review+2: Ivan Kolodyazhny <e0ne@e0ne.info> Workflow+1: Ivan Kolodyazhny <e0ne@e0ne.info> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 23 Apr 2018 10:37:15 +0000 Reviewed-on: https://review.openstack.org/558048 Project: openstack/horizon Branch: refs/heads/master
-rw-r--r--horizon/test/helpers.py3
-rw-r--r--openstack_dashboard/dashboards/admin/flavors/tests.py6
-rw-r--r--openstack_dashboard/dashboards/admin/networks/agents/tests.py2
-rw-r--r--openstack_dashboard/dashboards/admin/networks/ports/tests.py2
-rw-r--r--openstack_dashboard/dashboards/admin/networks/subnets/tests.py2
-rw-r--r--openstack_dashboard/dashboards/admin/networks/tests.py3
-rw-r--r--openstack_dashboard/dashboards/admin/overview/tests.py2
-rw-r--r--openstack_dashboard/dashboards/identity/domains/tests.py9
-rw-r--r--openstack_dashboard/dashboards/identity/groups/tests.py3
-rw-r--r--openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py2
-rw-r--r--openstack_dashboard/dashboards/identity/identity_providers/tests.py3
-rw-r--r--openstack_dashboard/dashboards/identity/mappings/tests.py3
-rw-r--r--openstack_dashboard/dashboards/identity/projects/tests.py21
-rw-r--r--openstack_dashboard/dashboards/identity/roles/tests.py3
-rw-r--r--openstack_dashboard/dashboards/identity/users/tests.py3
-rw-r--r--openstack_dashboard/dashboards/project/instances/tests.py4
-rw-r--r--openstack_dashboard/dashboards/project/routers/tests.py8
-rw-r--r--openstack_dashboard/test/helpers.py27
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_cinder.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_config.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_glance.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_keystone.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_network.py4
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_neutron.py16
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_nova.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_policy.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_swift.py2
-rw-r--r--openstack_dashboard/test/unit/api/rest/test_utils.py4
-rw-r--r--openstack_dashboard/test/unit/api/test_base.py12
-rw-r--r--openstack_dashboard/test/unit/api/test_nova.py2
-rw-r--r--openstack_dashboard/test/unit/usage/test_quotas.py2
31 files changed, 81 insertions, 79 deletions
diff --git a/horizon/test/helpers.py b/horizon/test/helpers.py
index 27fd158..2a1db8f 100644
--- a/horizon/test/helpers.py
+++ b/horizon/test/helpers.py
@@ -140,6 +140,9 @@ class TestCase(django_test.TestCase):
140 def setUp(self): 140 def setUp(self):
141 super(TestCase, self).setUp() 141 super(TestCase, self).setUp()
142 if self.use_mox: 142 if self.use_mox:
143 LOG.warning("'use_mox' will be dropped at the beginning of "
144 "'Stein' release. If you still depend on mox, "
145 "you must prepare mox environment in your test case.")
143 self.mox = mox.Mox() 146 self.mox = mox.Mox()
144 self._setup_test_data() 147 self._setup_test_data()
145 self._setup_factory() 148 self._setup_factory()
diff --git a/openstack_dashboard/dashboards/admin/flavors/tests.py b/openstack_dashboard/dashboards/admin/flavors/tests.py
index 1176bb1..f503d49 100644
--- a/openstack_dashboard/dashboards/admin/flavors/tests.py
+++ b/openstack_dashboard/dashboards/admin/flavors/tests.py
@@ -25,6 +25,9 @@ from openstack_dashboard.test import helpers as test
25 25
26 26
27class FlavorsViewTests(test.BaseAdminViewTests): 27class FlavorsViewTests(test.BaseAdminViewTests):
28
29 use_mox = True
30
28 @test.create_stubs({api.nova: ('flavor_list_paged',), 31 @test.create_stubs({api.nova: ('flavor_list_paged',),
29 flavors.Flavor: ('get_keys',), }) 32 flavors.Flavor: ('get_keys',), })
30 def test_index(self): 33 def test_index(self):
@@ -177,6 +180,9 @@ class FlavorsViewTests(test.BaseAdminViewTests):
177 180
178 181
179class BaseFlavorWorkflowTests(test.BaseAdminViewTests): 182class BaseFlavorWorkflowTests(test.BaseAdminViewTests):
183
184 use_mox = True
185
180 def _flavor_create_params(self, flavor, id=None): 186 def _flavor_create_params(self, flavor, id=None):
181 eph = getattr(flavor, 'OS-FLV-EXT-DATA:ephemeral') 187 eph = getattr(flavor, 'OS-FLV-EXT-DATA:ephemeral')
182 flavor_info = {"name": flavor.name, 188 flavor_info = {"name": flavor.name,
diff --git a/openstack_dashboard/dashboards/admin/networks/agents/tests.py b/openstack_dashboard/dashboards/admin/networks/agents/tests.py
index ac26073..e007059 100644
--- a/openstack_dashboard/dashboards/admin/networks/agents/tests.py
+++ b/openstack_dashboard/dashboards/admin/networks/agents/tests.py
@@ -26,6 +26,8 @@ NETWORKS_DETAIL_URL = 'horizon:admin:networks:detail'
26 26
27class NetworkAgentTests(test.BaseAdminViewTests): 27class NetworkAgentTests(test.BaseAdminViewTests):
28 28
29 use_mox = True
30
29 @test.create_stubs({api.neutron: ('agent_list', 31 @test.create_stubs({api.neutron: ('agent_list',
30 'network_get', 32 'network_get',
31 'list_dhcp_agent_hosting_networks',)}) 33 'list_dhcp_agent_hosting_networks',)})
diff --git a/openstack_dashboard/dashboards/admin/networks/ports/tests.py b/openstack_dashboard/dashboards/admin/networks/ports/tests.py
index cf049ab..fb774e8 100644
--- a/openstack_dashboard/dashboards/admin/networks/ports/tests.py
+++ b/openstack_dashboard/dashboards/admin/networks/ports/tests.py
@@ -31,6 +31,8 @@ NETWORKS_DETAIL_URL = 'horizon:admin:networks:detail'
31 31
32class NetworkPortTests(test.BaseAdminViewTests): 32class NetworkPortTests(test.BaseAdminViewTests):
33 33
34 use_mox = True
35
34 @test.create_stubs({api.neutron: ('network_get', 36 @test.create_stubs({api.neutron: ('network_get',
35 'port_get', 37 'port_get',
36 'is_extension_supported',)}) 38 'is_extension_supported',)})
diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py
index 3780929..9b17a85 100644
--- a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py
+++ b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py
@@ -32,6 +32,8 @@ NETWORKS_DETAIL_URL = 'horizon:admin:networks:detail'
32 32
33class NetworkSubnetTests(test.BaseAdminViewTests): 33class NetworkSubnetTests(test.BaseAdminViewTests):
34 34
35 use_mox = True
36
35 @test.create_stubs({api.neutron: ('network_get', 37 @test.create_stubs({api.neutron: ('network_get',
36 'subnet_get', 38 'subnet_get',
37 'is_extension_supported')}) 39 'is_extension_supported')})
diff --git a/openstack_dashboard/dashboards/admin/networks/tests.py b/openstack_dashboard/dashboards/admin/networks/tests.py
index a17a1ba..68c3b64 100644
--- a/openstack_dashboard/dashboards/admin/networks/tests.py
+++ b/openstack_dashboard/dashboards/admin/networks/tests.py
@@ -31,6 +31,9 @@ INDEX_URL = reverse('horizon:admin:networks:index')
31 31
32 32
33class NetworkTests(test.BaseAdminViewTests): 33class NetworkTests(test.BaseAdminViewTests):
34
35 use_mox = True
36
34 @test.create_stubs({api.neutron: ('network_list', 37 @test.create_stubs({api.neutron: ('network_list',
35 'list_dhcp_agent_hosting_networks', 38 'list_dhcp_agent_hosting_networks',
36 'is_extension_supported'), 39 'is_extension_supported'),
diff --git a/openstack_dashboard/dashboards/admin/overview/tests.py b/openstack_dashboard/dashboards/admin/overview/tests.py
index ea2f1c3..175634f 100644
--- a/openstack_dashboard/dashboards/admin/overview/tests.py
+++ b/openstack_dashboard/dashboards/admin/overview/tests.py
@@ -38,6 +38,8 @@ INDEX_URL = reverse('horizon:project:overview:index')
38 38
39class UsageViewTests(test.BaseAdminViewTests): 39class UsageViewTests(test.BaseAdminViewTests):
40 40
41 use_mox = True
42
41 def _stub_api_calls(self, nova_stu_enabled): 43 def _stub_api_calls(self, nova_stu_enabled):
42 self.mox.StubOutWithMock(api.nova, 'usage_list') 44 self.mox.StubOutWithMock(api.nova, 'usage_list')
43 self.mox.StubOutWithMock(api.nova, 'extension_supported') 45 self.mox.StubOutWithMock(api.nova, 'extension_supported')
diff --git a/openstack_dashboard/dashboards/identity/domains/tests.py b/openstack_dashboard/dashboards/identity/domains/tests.py
index c3ed4d2..26bd41e 100644
--- a/openstack_dashboard/dashboards/identity/domains/tests.py
+++ b/openstack_dashboard/dashboards/identity/domains/tests.py
@@ -36,6 +36,9 @@ GROUP_ROLE_PREFIX = constants.DOMAIN_GROUP_MEMBER_SLUG + "_role_"
36 36
37 37
38class DomainsViewTests(test.BaseAdminViewTests): 38class DomainsViewTests(test.BaseAdminViewTests):
39
40 use_mox = True
41
39 @test.create_stubs({api.keystone: ('domain_get', 42 @test.create_stubs({api.keystone: ('domain_get',
40 'domain_list',)}) 43 'domain_list',)})
41 def test_index(self): 44 def test_index(self):
@@ -175,6 +178,9 @@ class DomainsViewTests(test.BaseAdminViewTests):
175 178
176 179
177class CreateDomainWorkflowTests(test.BaseAdminViewTests): 180class CreateDomainWorkflowTests(test.BaseAdminViewTests):
181
182 use_mox = True
183
178 def _get_domain_info(self, domain): 184 def _get_domain_info(self, domain):
179 domain_info = {"name": domain.name, 185 domain_info = {"name": domain.name,
180 "description": domain.description, 186 "description": domain.description,
@@ -218,6 +224,9 @@ class CreateDomainWorkflowTests(test.BaseAdminViewTests):
218 224
219 225
220class UpdateDomainWorkflowTests(test.BaseAdminViewTests): 226class UpdateDomainWorkflowTests(test.BaseAdminViewTests):
227
228 use_mox = True
229
221 def _get_domain_info(self, domain): 230 def _get_domain_info(self, domain):
222 domain_info = {"domain_id": domain.id, 231 domain_info = {"domain_id": domain.id,
223 "name": domain.name, 232 "name": domain.name,
diff --git a/openstack_dashboard/dashboards/identity/groups/tests.py b/openstack_dashboard/dashboards/identity/groups/tests.py
index 572bb2d..2ab6ef0 100644
--- a/openstack_dashboard/dashboards/identity/groups/tests.py
+++ b/openstack_dashboard/dashboards/identity/groups/tests.py
@@ -32,6 +32,9 @@ GROUP_ADD_MEMBER_URL = reverse(constants.GROUPS_ADD_MEMBER_URL, args=[1])
32 32
33 33
34class GroupsViewTests(test.BaseAdminViewTests): 34class GroupsViewTests(test.BaseAdminViewTests):
35
36 use_mox = True
37
35 def _get_domain_id(self): 38 def _get_domain_id(self):
36 return self.request.session.get('domain_context', None) 39 return self.request.session.get('domain_context', None)
37 40
diff --git a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py
index 9148550..9fb7b4c 100644
--- a/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py
+++ b/openstack_dashboard/dashboards/identity/identity_providers/protocols/tests.py
@@ -31,6 +31,8 @@ PROTOCOLS_CREATE_URL = reverse(
31 31
32class ProtocolsViewTests(test.BaseAdminViewTests): 32class ProtocolsViewTests(test.BaseAdminViewTests):
33 33
34 use_mox = True
35
34 @test.create_stubs({api.keystone: ('mapping_list', 36 @test.create_stubs({api.keystone: ('mapping_list',
35 'protocol_create', )}) 37 'protocol_create', )})
36 def test_create(self): 38 def test_create(self):
diff --git a/openstack_dashboard/dashboards/identity/identity_providers/tests.py b/openstack_dashboard/dashboards/identity/identity_providers/tests.py
index 25e4e2a..1e7b125 100644
--- a/openstack_dashboard/dashboards/identity/identity_providers/tests.py
+++ b/openstack_dashboard/dashboards/identity/identity_providers/tests.py
@@ -31,6 +31,9 @@ IDPS_DETAIL_URL = reverse('horizon:identity:identity_providers:detail',
31 31
32 32
33class IdPsViewTests(test.BaseAdminViewTests): 33class IdPsViewTests(test.BaseAdminViewTests):
34
35 use_mox = True
36
34 @test.create_stubs({api.keystone: ('identity_provider_list',)}) 37 @test.create_stubs({api.keystone: ('identity_provider_list',)})
35 def test_index(self): 38 def test_index(self):
36 api.keystone.identity_provider_list(IgnoreArg()). \ 39 api.keystone.identity_provider_list(IgnoreArg()). \
diff --git a/openstack_dashboard/dashboards/identity/mappings/tests.py b/openstack_dashboard/dashboards/identity/mappings/tests.py
index f76cbc6..4bbf95f 100644
--- a/openstack_dashboard/dashboards/identity/mappings/tests.py
+++ b/openstack_dashboard/dashboards/identity/mappings/tests.py
@@ -31,6 +31,9 @@ MAPPINGS_UPDATE_URL = reverse('horizon:identity:mappings:update',
31 31
32 32
33class MappingsViewTests(test.BaseAdminViewTests): 33class MappingsViewTests(test.BaseAdminViewTests):
34
35 use_mox = True
36
34 @test.create_stubs({api.keystone: ('mapping_list',)}) 37 @test.create_stubs({api.keystone: ('mapping_list',)})
35 def test_index(self): 38 def test_index(self):
36 api.keystone.mapping_list(IgnoreArg()). \ 39 api.keystone.mapping_list(IgnoreArg()). \
diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py
index 170ef15..19ff7d7 100644
--- a/openstack_dashboard/dashboards/identity/projects/tests.py
+++ b/openstack_dashboard/dashboards/identity/projects/tests.py
@@ -41,6 +41,9 @@ PROJECT_DETAIL_URL = reverse('horizon:identity:projects:detail', args=[1])
41 41
42 42
43class TenantsViewTests(test.BaseAdminViewTests): 43class TenantsViewTests(test.BaseAdminViewTests):
44
45 use_mox = True
46
44 @test.create_stubs({api.keystone: ('domain_get', 47 @test.create_stubs({api.keystone: ('domain_get',
45 'tenant_list', 48 'tenant_list',
46 'domain_lookup'), 49 'domain_lookup'),
@@ -102,6 +105,9 @@ class TenantsViewTests(test.BaseAdminViewTests):
102 105
103 106
104class ProjectsViewNonAdminTests(test.TestCase): 107class ProjectsViewNonAdminTests(test.TestCase):
108
109 use_mox = True
110
105 @override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check') 111 @override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check')
106 @test.create_stubs({api.keystone: ('tenant_list', 112 @test.create_stubs({api.keystone: ('tenant_list',
107 'domain_lookup')}) 113 'domain_lookup')})
@@ -125,6 +131,9 @@ class ProjectsViewNonAdminTests(test.TestCase):
125 131
126 132
127class CreateProjectWorkflowTests(test.BaseAdminViewTests): 133class CreateProjectWorkflowTests(test.BaseAdminViewTests):
134
135 use_mox = True
136
128 def _get_project_info(self, project): 137 def _get_project_info(self, project):
129 domain = self._get_default_domain() 138 domain = self._get_default_domain()
130 project_info = {"name": project.name, 139 project_info = {"name": project.name,
@@ -443,6 +452,9 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
443 452
444 453
445class UpdateProjectWorkflowTests(test.BaseAdminViewTests): 454class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
455
456 use_mox = True
457
446 def _get_all_users(self, domain_id): 458 def _get_all_users(self, domain_id):
447 if not domain_id: 459 if not domain_id:
448 users = self.users.list() 460 users = self.users.list()
@@ -870,6 +882,9 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
870 882
871 883
872class UpdateQuotasWorkflowTests(test.BaseAdminViewTests): 884class UpdateQuotasWorkflowTests(test.BaseAdminViewTests):
885
886 use_mox = True
887
873 def _get_quota_info(self, quota): 888 def _get_quota_info(self, quota):
874 cinder_quota = self.cinder_quotas.first() 889 cinder_quota = self.cinder_quotas.first()
875 neutron_quota = self.neutron_quotas.first() 890 neutron_quota = self.neutron_quotas.first()
@@ -1048,6 +1063,9 @@ class UpdateQuotasWorkflowTests(test.BaseAdminViewTests):
1048 1063
1049 1064
1050class UsageViewTests(test.BaseAdminViewTests): 1065class UsageViewTests(test.BaseAdminViewTests):
1066
1067 use_mox = True
1068
1051 def _stub_nova_api_calls(self, nova_stu_enabled=True): 1069 def _stub_nova_api_calls(self, nova_stu_enabled=True):
1052 self.mox.StubOutWithMock(api.nova, 'usage_get') 1070 self.mox.StubOutWithMock(api.nova, 'usage_get')
1053 self.mox.StubOutWithMock(api.nova, 'extension_supported') 1071 self.mox.StubOutWithMock(api.nova, 'extension_supported')
@@ -1100,6 +1118,9 @@ class UsageViewTests(test.BaseAdminViewTests):
1100 1118
1101 1119
1102class DetailProjectViewTests(test.BaseAdminViewTests): 1120class DetailProjectViewTests(test.BaseAdminViewTests):
1121
1122 use_mox = True
1123
1103 @test.create_stubs({api.keystone: ('tenant_get',), 1124 @test.create_stubs({api.keystone: ('tenant_get',),
1104 quotas: ('enabled_quotas',)}) 1125 quotas: ('enabled_quotas',)})
1105 def test_detail_view(self): 1126 def test_detail_view(self):
diff --git a/openstack_dashboard/dashboards/identity/roles/tests.py b/openstack_dashboard/dashboards/identity/roles/tests.py
index cb2ca99..6f2a42a 100644
--- a/openstack_dashboard/dashboards/identity/roles/tests.py
+++ b/openstack_dashboard/dashboards/identity/roles/tests.py
@@ -29,6 +29,9 @@ INDEX_TEMPLATE = 'horizon/common/_data_table_view.html'
29 29
30 30
31class RolesViewTests(test.BaseAdminViewTests): 31class RolesViewTests(test.BaseAdminViewTests):
32
33 use_mox = True
34
32 @test.create_stubs({api.keystone: ('role_list',)}) 35 @test.create_stubs({api.keystone: ('role_list',)})
33 def test_index(self): 36 def test_index(self):
34 filters = {} 37 filters = {}
diff --git a/openstack_dashboard/dashboards/identity/users/tests.py b/openstack_dashboard/dashboards/identity/users/tests.py
index b0d6f59..86a0439 100644
--- a/openstack_dashboard/dashboards/identity/users/tests.py
+++ b/openstack_dashboard/dashboards/identity/users/tests.py
@@ -38,6 +38,9 @@ USER_CHANGE_PASSWORD_URL = reverse('horizon:identity:users:change_password',
38 38
39 39
40class UsersViewTests(test.BaseAdminViewTests): 40class UsersViewTests(test.BaseAdminViewTests):
41
42 use_mox = True
43
41 def _get_default_domain(self): 44 def _get_default_domain(self):
42 domain = {"id": self.request.session.get('domain_context', 45 domain = {"id": self.request.session.get('domain_context',
43 None), 46 None),
diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py
index 1e48b3f..dc9b90c 100644
--- a/openstack_dashboard/dashboards/project/instances/tests.py
+++ b/openstack_dashboard/dashboards/project/instances/tests.py
@@ -76,8 +76,6 @@ class InstanceTestBase(helpers.ResetImageAPIVersionMixin,
76 InstanceTestHelperMixin, 76 InstanceTestHelperMixin,
77 helpers.TestCase): 77 helpers.TestCase):
78 78
79 use_mox = False
80
81 def setUp(self): 79 def setUp(self):
82 super(InstanceTestBase, self).setUp() 80 super(InstanceTestBase, self).setUp()
83 if api.glance.VERSIONS.active < 2: 81 if api.glance.VERSIONS.active < 2:
@@ -4988,8 +4986,6 @@ class InstanceAjaxTests(helpers.TestCase, InstanceTestHelperMixin):
4988 4986
4989class ConsoleManagerTests(helpers.ResetImageAPIVersionMixin, helpers.TestCase): 4987class ConsoleManagerTests(helpers.ResetImageAPIVersionMixin, helpers.TestCase):
4990 4988
4991 use_mox = False
4992
4993 def setup_consoles(self): 4989 def setup_consoles(self):
4994 # Need to refresh with mocks or will fail since mox do not detect 4990 # Need to refresh with mocks or will fail since mox do not detect
4995 # the api_call() as mocked. 4991 # the api_call() as mocked.
diff --git a/openstack_dashboard/dashboards/project/routers/tests.py b/openstack_dashboard/dashboards/project/routers/tests.py
index fd0f231..645e92c 100644
--- a/openstack_dashboard/dashboards/project/routers/tests.py
+++ b/openstack_dashboard/dashboards/project/routers/tests.py
@@ -84,8 +84,6 @@ class RouterMixin(object):
84 84
85class RouterTestCase(object): 85class RouterTestCase(object):
86 86
87 use_mox = False
88
89 @test.create_mocks({api.neutron: ('router_list', 87 @test.create_mocks({api.neutron: ('router_list',
90 'network_list', 88 'network_list',
91 'is_extension_supported'), 89 'is_extension_supported'),
@@ -298,8 +296,6 @@ class RouterActionTests(test.TestCase):
298 INDEX_URL = reverse('horizon:%s:routers:index' % DASHBOARD) 296 INDEX_URL = reverse('horizon:%s:routers:index' % DASHBOARD)
299 DETAIL_PATH = 'horizon:%s:routers:detail' % DASHBOARD 297 DETAIL_PATH = 'horizon:%s:routers:detail' % DASHBOARD
300 298
301 use_mox = False
302
303 @test.create_mocks({api.neutron: ('router_create', 299 @test.create_mocks({api.neutron: ('router_create',
304 'get_feature_permission', 300 'get_feature_permission',
305 'network_list', 301 'network_list',
@@ -1050,8 +1046,6 @@ class RouterActionTests(test.TestCase):
1050 1046
1051class RouterRouteTestCase(object): 1047class RouterRouteTestCase(object):
1052 1048
1053 use_mox = False
1054
1055 @test.create_mocks({api.neutron: ('router_get', 1049 @test.create_mocks({api.neutron: ('router_get',
1056 'port_list', 1050 'port_list',
1057 'network_get', 1051 'network_get',
@@ -1165,8 +1159,6 @@ class RouterViewTests(RouterMixin, test.TestCase):
1165 DASHBOARD = 'project' 1159 DASHBOARD = 'project'
1166 INDEX_URL = reverse('horizon:%s:routers:index' % DASHBOARD) 1160 INDEX_URL = reverse('horizon:%s:routers:index' % DASHBOARD)
1167 1161
1168 use_mox = False
1169
1170 @test.create_mocks({api.neutron: ('router_list', 1162 @test.create_mocks({api.neutron: ('router_list',
1171 'network_list', 1163 'network_list',
1172 'is_extension_supported'), 1164 'is_extension_supported'),
diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py
index a9626ba..3bdcd23 100644
--- a/openstack_dashboard/test/helpers.py
+++ b/openstack_dashboard/test/helpers.py
@@ -261,11 +261,6 @@ class TestCase(horizon_helpers.TestCase):
261 # boolean variable to store failures 261 # boolean variable to store failures
262 missing_mocks = False 262 missing_mocks = False
263 263
264 # Most openstack_dashbaord tests depends on mox,
265 # we mark use_mox to True by default.
266 # Eventually we can drop this when mock migration has good progress.
267 use_mox = True
268
269 def fake_conn_request(self): 264 def fake_conn_request(self):
270 # print a stacktrace to illustrate where the unmocked API call 265 # print a stacktrace to illustrate where the unmocked API call
271 # is being made from 266 # is being made from
@@ -493,8 +488,16 @@ class APITestCase(TestCase):
493 For use with tests which deal with the underlying clients rather than 488 For use with tests which deal with the underlying clients rather than
494 stubbing out the openstack_dashboard.api.* methods. 489 stubbing out the openstack_dashboard.api.* methods.
495 """ 490 """
491
492 # NOTE: This test class depends on mox but does not declare use_mox = True
493 # to notify mox is no longer recommended.
494 # If a consumer would like to use this class, declare use_mox = True.
495
496 def setUp(self): 496 def setUp(self):
497 super(APITestCase, self).setUp() 497 super(APITestCase, self).setUp()
498 LOG.warning("APITestCase has been deprecated in favor of mock usage "
499 "and will be removed at the beginning of 'Stein' release. "
500 "Please convert your to use APIMockTestCase instead.")
498 utils.patch_middleware_get_user() 501 utils.patch_middleware_get_user()
499 502
500 def fake_keystoneclient(request, admin=False): 503 def fake_keystoneclient(request, admin=False):
@@ -547,7 +550,7 @@ class APITestCase(TestCase):
547 ) 550 )
548 551
549 def stub_novaclient(self): 552 def stub_novaclient(self):
550 self._warn_client('nova', 'S') 553 self._warn_client('nova', 'Stein')
551 if not hasattr(self, "novaclient"): 554 if not hasattr(self, "novaclient"):
552 self.mox.StubOutWithMock(nova_client, 'Client') 555 self.mox.StubOutWithMock(nova_client, 'Client')
553 # mock the api_version since MockObject.__init__ ignores it. 556 # mock the api_version since MockObject.__init__ ignores it.
@@ -562,14 +565,14 @@ class APITestCase(TestCase):
562 return self.novaclient 565 return self.novaclient
563 566
564 def stub_cinderclient(self): 567 def stub_cinderclient(self):
565 self._warn_client('cinder', 'S') 568 self._warn_client('cinder', 'Stein')
566 if not hasattr(self, "cinderclient"): 569 if not hasattr(self, "cinderclient"):
567 self.mox.StubOutWithMock(cinder_client, 'Client') 570 self.mox.StubOutWithMock(cinder_client, 'Client')
568 self.cinderclient = self.mox.CreateMock(cinder_client.Client) 571 self.cinderclient = self.mox.CreateMock(cinder_client.Client)
569 return self.cinderclient 572 return self.cinderclient
570 573
571 def stub_keystoneclient(self): 574 def stub_keystoneclient(self):
572 self._warn_client('keystone', 'S') 575 self._warn_client('keystone', 'Stein')
573 if not hasattr(self, "keystoneclient"): 576 if not hasattr(self, "keystoneclient"):
574 self.mox.StubOutWithMock(keystone_client, 'Client') 577 self.mox.StubOutWithMock(keystone_client, 'Client')
575 # NOTE(saschpe): Mock properties, MockObject.__init__ ignores them: 578 # NOTE(saschpe): Mock properties, MockObject.__init__ ignores them:
@@ -583,21 +586,21 @@ class APITestCase(TestCase):
583 return self.keystoneclient 586 return self.keystoneclient
584 587
585 def stub_glanceclient(self): 588 def stub_glanceclient(self):
586 self._warn_client('glance', 'S') 589 self._warn_client('glance', 'Stein')
587 if not hasattr(self, "glanceclient"): 590 if not hasattr(self, "glanceclient"):
588 self.mox.StubOutWithMock(glanceclient, 'Client') 591 self.mox.StubOutWithMock(glanceclient, 'Client')
589 self.glanceclient = self.mox.CreateMock(glanceclient.Client) 592 self.glanceclient = self.mox.CreateMock(glanceclient.Client)
590 return self.glanceclient 593 return self.glanceclient
591 594
592 def stub_neutronclient(self): 595 def stub_neutronclient(self):
593 self._warn_client('neutron', 'S') 596 self._warn_client('neutron', 'Stein')
594 if not hasattr(self, "neutronclient"): 597 if not hasattr(self, "neutronclient"):
595 self.mox.StubOutWithMock(neutron_client, 'Client') 598 self.mox.StubOutWithMock(neutron_client, 'Client')
596 self.neutronclient = self.mox.CreateMock(neutron_client.Client) 599 self.neutronclient = self.mox.CreateMock(neutron_client.Client)
597 return self.neutronclient 600 return self.neutronclient
598 601
599 def stub_swiftclient(self, expected_calls=1): 602 def stub_swiftclient(self, expected_calls=1):
600 self._warn_client('swift', 'S') 603 self._warn_client('swift', 'Stein')
601 if not hasattr(self, "swiftclient"): 604 if not hasattr(self, "swiftclient"):
602 self.mox.StubOutWithMock(swift_client, 'Connection') 605 self.mox.StubOutWithMock(swift_client, 'Connection')
603 self.swiftclient = self.mox.CreateMock(swift_client.Connection) 606 self.swiftclient = self.mox.CreateMock(swift_client.Connection)
@@ -617,8 +620,6 @@ class APITestCase(TestCase):
617 620
618class APIMockTestCase(TestCase): 621class APIMockTestCase(TestCase):
619 622
620 use_mox = False
621
622 def setUp(self): 623 def setUp(self):
623 super(APIMockTestCase, self).setUp() 624 super(APIMockTestCase, self).setUp()
624 utils.patch_middleware_get_user() 625 utils.patch_middleware_get_user()
diff --git a/openstack_dashboard/test/unit/api/rest/test_cinder.py b/openstack_dashboard/test/unit/api/rest/test_cinder.py
index 23717ee..a2b91d2 100644
--- a/openstack_dashboard/test/unit/api/rest/test_cinder.py
+++ b/openstack_dashboard/test/unit/api/rest/test_cinder.py
@@ -25,8 +25,6 @@ from openstack_dashboard.usage import quotas
25 25
26class CinderRestTestCase(test.TestCase): 26class CinderRestTestCase(test.TestCase):
27 27
28 use_mox = False
29
30 # 28 #
31 # Volumes 29 # Volumes
32 # 30 #
diff --git a/openstack_dashboard/test/unit/api/rest/test_config.py b/openstack_dashboard/test/unit/api/rest/test_config.py
index 8e1ca1f..dcb1473 100644
--- a/openstack_dashboard/test/unit/api/rest/test_config.py
+++ b/openstack_dashboard/test/unit/api/rest/test_config.py
@@ -18,8 +18,6 @@ from openstack_dashboard.test import helpers as test
18 18
19class ConfigRestTestCase(test.TestCase): 19class ConfigRestTestCase(test.TestCase):
20 20
21 use_mox = False
22
23 def test_settings_config_get(self): 21 def test_settings_config_get(self):
24 request = self.mock_rest_request() 22 request = self.mock_rest_request()
25 response = config.Settings().get(request) 23 response = config.Settings().get(request)
diff --git a/openstack_dashboard/test/unit/api/rest/test_glance.py b/openstack_dashboard/test/unit/api/rest/test_glance.py
index e0e069d..9b0711e 100644
--- a/openstack_dashboard/test/unit/api/rest/test_glance.py
+++ b/openstack_dashboard/test/unit/api/rest/test_glance.py
@@ -21,8 +21,6 @@ from openstack_dashboard.test import helpers as test
21 21
22class ImagesRestTestCase(test.ResetImageAPIVersionMixin, test.TestCase): 22class ImagesRestTestCase(test.ResetImageAPIVersionMixin, test.TestCase):
23 23
24 use_mox = False
25
26 def setUp(self): 24 def setUp(self):
27 super(ImagesRestTestCase, self).setUp() 25 super(ImagesRestTestCase, self).setUp()
28 api.glance.VERSIONS.clear_active_cache() 26 api.glance.VERSIONS.clear_active_cache()
diff --git a/openstack_dashboard/test/unit/api/rest/test_keystone.py b/openstack_dashboard/test/unit/api/rest/test_keystone.py
index 32550b5..88e4111 100644
--- a/openstack_dashboard/test/unit/api/rest/test_keystone.py
+++ b/openstack_dashboard/test/unit/api/rest/test_keystone.py
@@ -24,8 +24,6 @@ from openstack_dashboard.test import helpers as test
24 24
25class KeystoneRestTestCase(test.TestCase): 25class KeystoneRestTestCase(test.TestCase):
26 26
27 use_mox = False
28
29 # 27 #
30 # Version 28 # Version
31 # 29 #
diff --git a/openstack_dashboard/test/unit/api/rest/test_network.py b/openstack_dashboard/test/unit/api/rest/test_network.py
index 3aadc20..ea8e823 100644
--- a/openstack_dashboard/test/unit/api/rest/test_network.py
+++ b/openstack_dashboard/test/unit/api/rest/test_network.py
@@ -20,8 +20,6 @@ from openstack_dashboard.test import helpers as test
20 20
21class RestNetworkApiSecurityGroupTests(test.TestCase): 21class RestNetworkApiSecurityGroupTests(test.TestCase):
22 22
23 use_mox = False
24
25 @test.create_mocks({api.neutron: ['security_group_list']}) 23 @test.create_mocks({api.neutron: ['security_group_list']})
26 def test_security_group_detailed(self): 24 def test_security_group_detailed(self):
27 request = self.mock_rest_request() 25 request = self.mock_rest_request()
@@ -38,8 +36,6 @@ class RestNetworkApiSecurityGroupTests(test.TestCase):
38 36
39class RestNetworkApiFloatingIpTests(test.TestCase): 37class RestNetworkApiFloatingIpTests(test.TestCase):
40 38
41 use_mox = False
42
43 @test.create_mocks({api.neutron: ['tenant_floating_ip_list']}) 39 @test.create_mocks({api.neutron: ['tenant_floating_ip_list']})
44 def test_floating_ip_list(self): 40 def test_floating_ip_list(self):
45 request = self.mock_rest_request() 41 request = self.mock_rest_request()
diff --git a/openstack_dashboard/test/unit/api/rest/test_neutron.py b/openstack_dashboard/test/unit/api/rest/test_neutron.py
index c182577..b6c0ecb 100644
--- a/openstack_dashboard/test/unit/api/rest/test_neutron.py
+++ b/openstack_dashboard/test/unit/api/rest/test_neutron.py
@@ -25,8 +25,6 @@ from openstack_dashboard.usage import quotas
25 25
26class NeutronNetworksTestCase(test.TestCase): 26class NeutronNetworksTestCase(test.TestCase):
27 27
28 use_mox = False
29
30 def _dictify_network(self, network): 28 def _dictify_network(self, network):
31 net_dict = network.to_dict() 29 net_dict = network.to_dict()
32 net_dict['subnets'] = [s.to_dict() for s in net_dict['subnets']] 30 net_dict['subnets'] = [s.to_dict() for s in net_dict['subnets']]
@@ -112,8 +110,6 @@ class NeutronNetworksTestCase(test.TestCase):
112 110
113class NeutronSubnetsTestCase(test.TestCase): 111class NeutronSubnetsTestCase(test.TestCase):
114 112
115 use_mox = False
116
117 @mock.patch.object(api.neutron, 'subnet_list') 113 @mock.patch.object(api.neutron, 'subnet_list')
118 def test_get(self, mock_subnet_list): 114 def test_get(self, mock_subnet_list):
119 network_id = self.networks.first().id 115 network_id = self.networks.first().id
@@ -146,8 +142,6 @@ class NeutronSubnetsTestCase(test.TestCase):
146 142
147class NeutronPortsTestCase(test.TestCase): 143class NeutronPortsTestCase(test.TestCase):
148 144
149 use_mox = False
150
151 @mock.patch.object(api.neutron, 'port_list_with_trunk_types') 145 @mock.patch.object(api.neutron, 'port_list_with_trunk_types')
152 def test_get(self, mock_port_list_with_trunk_types): 146 def test_get(self, mock_port_list_with_trunk_types):
153 network_id = self.networks.first().id 147 network_id = self.networks.first().id
@@ -162,8 +156,6 @@ class NeutronPortsTestCase(test.TestCase):
162 156
163class NeutronTrunkTestCase(test.TestCase): 157class NeutronTrunkTestCase(test.TestCase):
164 158
165 use_mox = False
166
167 @mock.patch.object(api.neutron, 'trunk_delete') 159 @mock.patch.object(api.neutron, 'trunk_delete')
168 def test_trunk_delete(self, mock_trunk_delete): 160 def test_trunk_delete(self, mock_trunk_delete):
169 mock_trunk_delete.return_value = None 161 mock_trunk_delete.return_value = None
@@ -198,8 +190,6 @@ class NeutronTrunkTestCase(test.TestCase):
198 190
199class NeutronTrunksTestCase(test.TestCase): 191class NeutronTrunksTestCase(test.TestCase):
200 192
201 use_mox = False
202
203 @mock.patch.object(api.neutron, 'trunk_list') 193 @mock.patch.object(api.neutron, 'trunk_list')
204 def test_trunks_get(self, mock_trunk_list): 194 def test_trunks_get(self, mock_trunk_list):
205 request = self.mock_rest_request(GET=django_request.QueryDict()) 195 request = self.mock_rest_request(GET=django_request.QueryDict())
@@ -227,8 +217,6 @@ class NeutronTrunksTestCase(test.TestCase):
227 217
228class NeutronExtensionsTestCase(test.TestCase): 218class NeutronExtensionsTestCase(test.TestCase):
229 219
230 use_mox = False
231
232 @mock.patch.object(api.neutron, 'list_extensions') 220 @mock.patch.object(api.neutron, 'list_extensions')
233 def test_list_extensions(self, mock_list_extensions): 221 def test_list_extensions(self, mock_list_extensions):
234 request = self.mock_rest_request(**{'GET': {}}) 222 request = self.mock_rest_request(**{'GET': {}})
@@ -241,8 +229,6 @@ class NeutronExtensionsTestCase(test.TestCase):
241 229
242class NeutronDefaultQuotasTestCase(test.TestCase): 230class NeutronDefaultQuotasTestCase(test.TestCase):
243 231
244 use_mox = False
245
246 @test.create_mocks({api.base: ['is_service_enabled'], 232 @test.create_mocks({api.base: ['is_service_enabled'],
247 api.neutron: ['tenant_quota_get']}) 233 api.neutron: ['tenant_quota_get']})
248 def test_quotas_sets_defaults_get_when_service_is_enabled(self): 234 def test_quotas_sets_defaults_get_when_service_is_enabled(self):
@@ -283,8 +269,6 @@ class NeutronDefaultQuotasTestCase(test.TestCase):
283 269
284class NeutronQuotaSetsTestCase(test.TestCase): 270class NeutronQuotaSetsTestCase(test.TestCase):
285 271
286 use_mox = False
287
288 @test.create_mocks({api.base: ['is_service_enabled'], 272 @test.create_mocks({api.base: ['is_service_enabled'],
289 api.neutron: ['is_extension_supported', 273 api.neutron: ['is_extension_supported',
290 'tenant_quota_update'], 274 'tenant_quota_update'],
diff --git a/openstack_dashboard/test/unit/api/rest/test_nova.py b/openstack_dashboard/test/unit/api/rest/test_nova.py
index 7d375b6..4190026 100644
--- a/openstack_dashboard/test/unit/api/rest/test_nova.py
+++ b/openstack_dashboard/test/unit/api/rest/test_nova.py
@@ -28,8 +28,6 @@ from openstack_dashboard.usage import quotas
28 28
29class NovaRestTestCase(test.TestCase): 29class NovaRestTestCase(test.TestCase):
30 30
31 use_mox = False
32
33 # 31 #
34 # Snapshots 32 # Snapshots
35 # 33 #
diff --git a/openstack_dashboard/test/unit/api/rest/test_policy.py b/openstack_dashboard/test/unit/api/rest/test_policy.py
index ed6eb2f..7896fe3 100644
--- a/openstack_dashboard/test/unit/api/rest/test_policy.py
+++ b/openstack_dashboard/test/unit/api/rest/test_policy.py
@@ -20,8 +20,6 @@ from openstack_dashboard.test import helpers as test
20 20
21class PolicyRestTestCase(test.TestCase): 21class PolicyRestTestCase(test.TestCase):
22 22
23 use_mox = False
24
25 @override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check') 23 @override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check')
26 def _test_policy(self, body, expected=True): 24 def _test_policy(self, body, expected=True):
27 request = self.mock_rest_request(body=body) 25 request = self.mock_rest_request(body=body)
diff --git a/openstack_dashboard/test/unit/api/rest/test_swift.py b/openstack_dashboard/test/unit/api/rest/test_swift.py
index 6e05294..0d7512b 100644
--- a/openstack_dashboard/test/unit/api/rest/test_swift.py
+++ b/openstack_dashboard/test/unit/api/rest/test_swift.py
@@ -20,8 +20,6 @@ from openstack_dashboard.test import helpers as test
20 20
21class SwiftRestTestCase(test.TestCase): 21class SwiftRestTestCase(test.TestCase):
22 22
23 use_mox = False
24
25 # 23 #
26 # Version 24 # Version
27 # 25 #
diff --git a/openstack_dashboard/test/unit/api/rest/test_utils.py b/openstack_dashboard/test/unit/api/rest/test_utils.py
index 370ac2e..a5920d3 100644
--- a/openstack_dashboard/test/unit/api/rest/test_utils.py
+++ b/openstack_dashboard/test/unit/api/rest/test_utils.py
@@ -18,8 +18,6 @@ from openstack_dashboard.test import helpers as test
18 18
19class RestUtilsTestCase(test.TestCase): 19class RestUtilsTestCase(test.TestCase):
20 20
21 use_mox = False
22
23 def test_api_success(self): 21 def test_api_success(self):
24 @utils.ajax() 22 @utils.ajax()
25 def f(self, request): 23 def f(self, request):
@@ -168,8 +166,6 @@ class RestUtilsTestCase(test.TestCase):
168 166
169class JSONEncoderTestCase(test.TestCase): 167class JSONEncoderTestCase(test.TestCase):
170 168
171 use_mox = False
172
173 # NOTE(tsufiev): NaN numeric is "conventional" in a sense that the custom 169 # NOTE(tsufiev): NaN numeric is "conventional" in a sense that the custom
174 # NaNJSONEncoder encoder translates it to the same token that the standard 170 # NaNJSONEncoder encoder translates it to the same token that the standard
175 # JSONEncoder encoder does 171 # JSONEncoder encoder does
diff --git a/openstack_dashboard/test/unit/api/test_base.py b/openstack_dashboard/test/unit/api/test_base.py
index 6007f19..016ac72 100644
--- a/openstack_dashboard/test/unit/api/test_base.py
+++ b/openstack_dashboard/test/unit/api/test_base.py
@@ -60,8 +60,6 @@ class APIDict(api_base.APIDictWrapper):
60 60
61class APIVersionTests(test.TestCase): 61class APIVersionTests(test.TestCase):
62 62
63 use_mox = False
64
65 def test_equal(self): 63 def test_equal(self):
66 version = api_base.Version('1.0') 64 version = api_base.Version('1.0')
67 self.assertEqual(1, version) 65 self.assertEqual(1, version)
@@ -109,8 +107,6 @@ class APIVersionTests(test.TestCase):
109# Wrapper classes that only define _attrs don't need extra testing. 107# Wrapper classes that only define _attrs don't need extra testing.
110class APIResourceWrapperTests(test.TestCase): 108class APIResourceWrapperTests(test.TestCase):
111 109
112 use_mox = False
113
114 def test_get_attribute(self): 110 def test_get_attribute(self):
115 resource = APIResource.get_instance() 111 resource = APIResource.get_instance()
116 self.assertEqual('foo', resource.foo) 112 self.assertEqual('foo', resource.foo)
@@ -138,8 +134,6 @@ class APIResourceWrapperTests(test.TestCase):
138 134
139class APIDictWrapperTests(test.TestCase): 135class APIDictWrapperTests(test.TestCase):
140 136
141 use_mox = False
142
143 # APIDict allows for both attribute access and dictionary style [element] 137 # APIDict allows for both attribute access and dictionary style [element]
144 # style access. Test both 138 # style access. Test both
145 def test_get_item(self): 139 def test_get_item(self):
@@ -208,8 +202,6 @@ class APIDictWrapperTests(test.TestCase):
208 202
209class ApiVersionTests(test.TestCase): 203class ApiVersionTests(test.TestCase):
210 204
211 use_mox = False
212
213 def setUp(self): 205 def setUp(self):
214 super(ApiVersionTests, self).setUp() 206 super(ApiVersionTests, self).setUp()
215 self.previous_settings = settings.OPENSTACK_API_VERSIONS 207 self.previous_settings = settings.OPENSTACK_API_VERSIONS
@@ -247,8 +239,6 @@ class ApiVersionTests(test.TestCase):
247class ApiHelperTests(test.TestCase): 239class ApiHelperTests(test.TestCase):
248 """Tests for functions that don't use one of the api objects.""" 240 """Tests for functions that don't use one of the api objects."""
249 241
250 use_mox = False
251
252 def test_url_for(self): 242 def test_url_for(self):
253 url = api_base.url_for(self.request, 'image') 243 url = api_base.url_for(self.request, 'image')
254 self.assertEqual('http://public.glance.example.com:9292', url) 244 self.assertEqual('http://public.glance.example.com:9292', url)
@@ -304,8 +294,6 @@ class ApiHelperTests(test.TestCase):
304 294
305class QuotaSetTests(test.TestCase): 295class QuotaSetTests(test.TestCase):
306 296
307 use_mox = False
308
309 def test_quotaset_add_with_plus(self): 297 def test_quotaset_add_with_plus(self):
310 quota_dict = {'foo': 1, 'bar': 10} 298 quota_dict = {'foo': 1, 'bar': 10}
311 other_quota_dict = {'my_test': 12} 299 other_quota_dict = {'my_test': 12}
diff --git a/openstack_dashboard/test/unit/api/test_nova.py b/openstack_dashboard/test/unit/api/test_nova.py
index cd00640..2df8cc9 100644
--- a/openstack_dashboard/test/unit/api/test_nova.py
+++ b/openstack_dashboard/test/unit/api/test_nova.py
@@ -36,8 +36,6 @@ from openstack_dashboard.test import helpers as test
36 36
37class ServerWrapperTests(test.TestCase): 37class ServerWrapperTests(test.TestCase):
38 38
39 use_mox = False
40
41 def test_get_base_attribute(self): 39 def test_get_base_attribute(self):
42 server = api.nova.Server(self.servers.first(), self.request) 40 server = api.nova.Server(self.servers.first(), self.request)
43 self.assertEqual(self.servers.first().id, server.id) 41 self.assertEqual(self.servers.first().id, server.id)
diff --git a/openstack_dashboard/test/unit/usage/test_quotas.py b/openstack_dashboard/test/unit/usage/test_quotas.py
index 5ee948f..66075c9 100644
--- a/openstack_dashboard/test/unit/usage/test_quotas.py
+++ b/openstack_dashboard/test/unit/usage/test_quotas.py
@@ -34,8 +34,6 @@ from openstack_dashboard.usage import quotas
34 34
35class QuotaTests(test.APITestCase): 35class QuotaTests(test.APITestCase):
36 36
37 use_mox = False
38
39 def _mock_service_enabled(self, compute_enabled=True, 37 def _mock_service_enabled(self, compute_enabled=True,
40 network_enabled=False, volume_enabled=True): 38 network_enabled=False, volume_enabled=True):
41 services = {'network': network_enabled, 39 services = {'network': network_enabled,