diff --git a/openstack_dashboard/test/api_tests/config_rest_tests.py b/openstack_dashboard/test/api_tests/config_rest_tests.py index b9747ae490..0dd05c447f 100644 --- a/openstack_dashboard/test/api_tests/config_rest_tests.py +++ b/openstack_dashboard/test/api_tests/config_rest_tests.py @@ -17,22 +17,10 @@ from openstack_dashboard.test import helpers as test class ConfigRestTestCase(test.TestCase): - def assertContains(self, response, expected_content): - if response.find(expected_content) > 0: - return - self.fail('%s does not contain %s' % - (response, expected_content)) - - def assertNotContains(self, response, expected_content): - if response.find(expected_content) < 0: - return - self.fail('%s contains %s when it should not' % - (response, expected_content)) - def test_settings_config_get(self): request = self.mock_rest_request() response = config.Settings().get(request) self.assertStatusCode(response, 200) - self.assertContains(response.content, "REST_API_SETTING_1") - self.assertContains(response.content, "REST_API_SETTING_2") - self.assertNotContains(response.content, "REST_API_SECURITY") + self.assertIn(b"REST_API_SETTING_1", response.content) + self.assertIn(b"REST_API_SETTING_2", response.content) + self.assertNotIn(b"REST_API_SECURITY", response.content) diff --git a/tox.ini b/tox.ini index 5bb1c115e3..d68ee5cdd6 100644 --- a/tox.ini +++ b/tox.ini @@ -46,6 +46,7 @@ commands = openstack_dashboard.test.api_tests.base_tests.QuotaSetTests \ openstack_dashboard.test.api_tests.ceilometer_tests \ openstack_dashboard.test.api_tests.cinder_tests \ + openstack_dashboard.test.api_tests.config_rest_tests \ openstack_dashboard.test.api_tests.fwaas_tests \ openstack_dashboard.test.api_tests.keystone_tests \ openstack_dashboard.test.api_tests.lbaas_tests \