From 2b7cd385157881490d81c13300156ac825e44a60 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 14 Oct 2015 17:24:08 +0200 Subject: [PATCH] Port dashboard router tests on Python 3 * Decode HTTP body from UTF-8 to get text on Python 3 * tox.ini: add routers tests to Python 3 Partial-Implements: blueprint porting-python3 Change-Id: Idc93818c4b62f782035604090b7c6fda459cf6fa --- openstack_dashboard/dashboards/admin/routers/tests.py | 6 ++++-- tox.ini | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/routers/tests.py b/openstack_dashboard/dashboards/admin/routers/tests.py index 530a8be437..f86e62c3d5 100644 --- a/openstack_dashboard/dashboards/admin/routers/tests.py +++ b/openstack_dashboard/dashboards/admin/routers/tests.py @@ -118,7 +118,8 @@ class RouterTests(test.BaseAdminViewTests, r_test.RouterTests): res = self.client.post(self.INDEX_URL, formData, follow=True) self.assertNoFormErrors(res) self.assertMessageCount(response=res, success=1) - self.assertIn('Deleted Router: ' + router.name, res.content) + self.assertIn('Deleted Router: ' + router.name, + res.content.decode('utf-8')) @test.create_stubs({api.neutron: ('router_list', 'network_list', 'port_list', 'router_remove_interface', @@ -161,7 +162,8 @@ class RouterTests(test.BaseAdminViewTests, r_test.RouterTests): res = self.client.post(self.INDEX_URL, formData, follow=True) self.assertNoFormErrors(res) self.assertMessageCount(response=res, success=1) - self.assertIn('Deleted Router: ' + router.name, res.content) + self.assertIn('Deleted Router: ' + router.name, + res.content.decode('utf-8')) class RouterRouteTest(test.BaseAdminViewTests, r_test.RouterRouteTests): diff --git a/tox.ini b/tox.ini index d0739a4aa6..24dfd00550 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,7 @@ commands = openstack_dashboard.contrib.sahara.content.data_processing.jobs.tests \ openstack_dashboard.dashboards.admin.aggregates \ openstack_dashboard.dashboards.admin.metering \ + openstack_dashboard.dashboards.admin.routers \ openstack_dashboard.dashboards.admin.volumes.volumes.tests \ openstack_dashboard.dashboards.identity.users \ openstack_dashboard.dashboards.project.access_and_security.api_access.tests \