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
This commit is contained in:
Victor Stinner 2015-10-14 17:24:08 +02:00
parent 49671ca4cf
commit 2b7cd38515
2 changed files with 5 additions and 2 deletions

View File

@ -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):

View File

@ -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 \