diff --git a/horizon/test/unit/tables/test_tables.py b/horizon/test/unit/tables/test_tables.py index 8a82f9e7e1..7d9aae74e7 100644 --- a/horizon/test/unit/tables/test_tables.py +++ b/horizon/test/unit/tables/test_tables.py @@ -432,7 +432,8 @@ class DataTableTests(test.TestCase): '', '', '', - '']) + ''], + transform=repr) # Actions (these also test ordering) self.assertQuerysetEqual(list(self.table.base_actions.values()), ['', @@ -440,18 +441,21 @@ class DataTableTests(test.TestCase): '', '', '', - '']) + ''], + transform=repr) self.assertQuerysetEqual(self.table.get_table_actions(), ['', '', '', - '']) + ''], + transform=repr) self.assertQuerysetEqual(self.table.get_row_actions(TEST_DATA[0]), ['', '', '', '', - '']) + ''], + transform=repr) # Auto-generated columns multi_select = self.table.columns['multi_select'] self.assertEqual("multi_select", multi_select.auto) @@ -472,7 +476,9 @@ class DataTableTests(test.TestCase): self.assertEqual(TEST_DATA, self.table.data) # The column "restricted" is not rendered because of policy expected_columns = [''] - self.assertQuerysetEqual(self.table.get_columns(), expected_columns) + self.assertQuerysetEqual(self.table.get_columns(), + expected_columns, + transform=repr) @override_settings(POLICY_CHECK_FUNCTION=lambda *args: True) def test_table_column_policy_allowed(self): @@ -480,7 +486,8 @@ class DataTableTests(test.TestCase): self.assertEqual(TEST_DATA, self.table.data) # Policy check returns True so the column "restricted" is rendered expected_columns = ['', ''] - self.assertQuerysetEqual(self.table.get_columns(), expected_columns) + self.assertQuerysetEqual(self.table.get_columns(), expected_columns, + transform=repr) def test_table_force_no_multiselect(self): class TempTable(MyTable): @@ -492,7 +499,8 @@ class DataTableTests(test.TestCase): self.table = TempTable(self.request, TEST_DATA) self.assertQuerysetEqual(self.table.get_columns(), ['', - '']) + ''], + transform=repr) def test_table_force_no_actions_column(self): class TempTable(MyTable): @@ -504,7 +512,8 @@ class DataTableTests(test.TestCase): self.table = TempTable(self.request, TEST_DATA) self.assertQuerysetEqual(self.table.get_columns(), ['', - '']) + ''], + transform=repr) def test_table_natural_no_inline_editing(self): class TempTable(MyTable): @@ -530,7 +539,8 @@ class DataTableTests(test.TestCase): self.table = TempTable(self.request, TEST_DATA) self.assertQuerysetEqual(self.table.get_columns(), ['', - '']) + ''], + transform=repr) def test_table_natural_no_multiselect(self): class TempTable(MyTable): @@ -540,7 +550,8 @@ class DataTableTests(test.TestCase): self.table = TempTable(self.request, TEST_DATA) self.assertQuerysetEqual(self.table.get_columns(), ['', - '']) + ''], + transform=repr) def test_table_column_inheritance(self): class TempTable(MyTable): @@ -561,25 +572,30 @@ class DataTableTests(test.TestCase): '', '', '', - '']) + ''], + transform=repr) def test_table_construction(self): self.table = MyTable(self.request, TEST_DATA) # Verify we retrieve the right columns for headers columns = self.table.get_columns() - self.assertQuerysetEqual(columns, ['', - '', - '', - '', - '', - '', - '']) + self.assertQuerysetEqual(columns, + ['', + '', + '', + '', + '', + '', + ''], + transform=repr) # Verify we retrieve the right rows from our data rows = self.table.get_rows() - self.assertQuerysetEqual(rows, ['', - '', - '', - '']) + self.assertQuerysetEqual(rows, + ['', + '', + '', + ''], + transform=repr) # Verify each row contains the right cells self.assertQuerysetEqual(rows[0].get_cells(), ['', @@ -588,7 +604,8 @@ class DataTableTests(test.TestCase): '', '', '', - '']) + ''], + transform=repr) def test_table_column(self): self.table = MyTable(self.request, TEST_DATA) @@ -814,7 +831,8 @@ class DataTableTests(test.TestCase): req = self.factory.post('/my_url/', {action_string: '2'}) self.table = TempTable(req, TEST_DATA) self.assertQuerysetEqual(self.table.get_table_actions(), - ['']) + [''], + transform=repr) handled = self.table.maybe_handle() self.assertIsNone(handled) self.assertQuerysetEqual(self.table.filtered_data, @@ -985,7 +1003,8 @@ class DataTableTests(test.TestCase): ['', '', '', - '']) + ''], + transform=repr) # Zero objects in table # BatchAction not available @@ -993,7 +1012,8 @@ class DataTableTests(test.TestCase): self.table = MyTable(req, None) self.assertQuerysetEqual(self.table.get_table_actions(), ['', - '']) + ''], + transform=repr) # Filtering action_string = "my_table__filter__q" @@ -1209,7 +1229,8 @@ class DataTableTests(test.TestCase): '', '', '', - ]) + ], + transform=repr) # can_be_selected = False self.assertEqual("", row.get_cells()[0].data) # can_be_selected = True diff --git a/horizon/test/unit/tabs/test_tabs.py b/horizon/test/unit/tabs/test_tabs.py index 7765b56426..9490d09746 100644 --- a/horizon/test/unit/tabs/test_tabs.py +++ b/horizon/test/unit/tabs/test_tabs.py @@ -142,10 +142,12 @@ class TabTests(test.TestCase): # "tab_disallowed" should NOT be in this list. # "tab_with_policy" should be present, since our policy check # always passes - self.assertQuerysetEqual(tabs, ['', - '', - '', - '']) + self.assertQuerysetEqual(tabs, + ['', + '', + '', + ''], + transform=repr) # Test get_id self.assertEqual("tab_group", tg.get_id()) # get_default_classes @@ -169,9 +171,11 @@ class TabTests(test.TestCase): # "tab_disallowed" should NOT be in this list, it's not allowed # "tab_with_policy" should also not be present as its # policy check failed - self.assertQuerysetEqual(tabs, ['', - '', - '']) + self.assertQuerysetEqual(tabs, + ['', + '', + ''], + transform=repr) @test.update_settings( HORIZON_CONFIG={'extra_tabs': { @@ -187,9 +191,11 @@ class TabTests(test.TestCase): tabs = tg.get_tabs() # "tab_disallowed" should NOT be in this list. # Other tabs must be ordered in the priorities in HORIZON_CONFIG. - self.assertQuerysetEqual(tabs, ['', - '', - '']) + self.assertQuerysetEqual(tabs, + ['', + '', + ''], + transform=repr) def test_tab_group_active_tab(self): tg = Group(self.request) diff --git a/horizon/test/unit/test_base.py b/horizon/test/unit/test_base.py index 8a40d77fd9..fe49f26d24 100644 --- a/horizon/test/unit/test_base.py +++ b/horizon/test/unit/test_base.py @@ -154,7 +154,8 @@ class HorizonTests(BaseHorizonTests): self.assertQuerysetEqual(horizon.get_dashboards(), ['', '', - '']) + ''], + transform=repr) # Removal self.assertEqual(3, len(base.Horizon._registry)) @@ -177,7 +178,8 @@ class HorizonTests(BaseHorizonTests): ['', '', '', - '']) + ''], + transform=repr) # Removal self.assertEqual(4, len(base.Horizon._registry)) @@ -203,7 +205,8 @@ class HorizonTests(BaseHorizonTests): self.assertEqual(base.Horizon, cats._registered_with) self.assertQuerysetEqual(cats.get_panels(), ['', - '']) + ''], + transform=repr) self.assertEqual("/cats/", cats.get_absolute_url()) self.assertEqual("Cats", cats.name) @@ -211,11 +214,13 @@ class HorizonTests(BaseHorizonTests): # as a panel group. cats.register(MyPanel) self.assertQuerysetEqual(list(cats.get_panel_groups()['other']), - ['']) + [''], + transform=repr) # Test that panels defined as a tuple still return a PanelGroup dogs = horizon.get_dashboard("dogs") self.assertQuerysetEqual(list(dogs.get_panel_groups().values()), - ['']) + [''], + transform=repr) # Test registering a module with a dashboard that defines panels # as a tuple. @@ -223,7 +228,8 @@ class HorizonTests(BaseHorizonTests): dogs.register(MyPanel) self.assertQuerysetEqual(dogs.get_panels(), ['', - '']) + ''], + transform=repr) cats.unregister(MyPanel) dogs.unregister(MyPanel) @@ -424,7 +430,8 @@ class CustomPanelTests(BaseHorizonTests): cats = horizon.get_dashboard("cats") self.assertEqual("WildCats", cats.name) self.assertQuerysetEqual(cats.get_panels(), - ['']) + [''], + transform=repr) with self.assertRaises(base.NotRegistered): horizon.get_dashboard("dogs") @@ -545,12 +552,14 @@ class RbacHorizonTests(test.TestCase): cats = horizon.get_dashboard("cats") self.assertEqual(cats._registered_with, base.Horizon) self.assertQuerysetEqual(cats.get_panels(), - ['']) + [''], + transform=repr) self.assertFalse(cats.can_access(context)) dogs = horizon.get_dashboard("dogs") self.assertEqual(dogs._registered_with, base.Horizon) self.assertQuerysetEqual(dogs.get_panels(), - ['']) + [''], + transform=repr) self.assertTrue(dogs.can_access(context)) diff --git a/horizon/test/unit/workflows/test_workflows.py b/horizon/test/unit/workflows/test_workflows.py index b2d3135a3b..a01c8b73cc 100644 --- a/horizon/test/unit/workflows/test_workflows.py +++ b/horizon/test/unit/workflows/test_workflows.py @@ -203,7 +203,8 @@ class WorkflowsTests(test.TestCase): self.assertQuerysetEqual(flow.steps, ['', '', - '']) + ''], + transform=repr) self.assertEqual(set(['project_id']), flow.depends_on) @test.update_settings(HORIZON_CONFIG={'extra_steps': { @@ -221,8 +222,8 @@ class WorkflowsTests(test.TestCase): ['', '', '', - '', - ]) + ''], + transform=repr) def test_step_construction(self): step_one = StepOne(WorkflowForTesting(self.request)) @@ -327,14 +328,16 @@ class WorkflowsTests(test.TestCase): flow = WorkflowForTesting(req) self.assertQuerysetEqual(flow.steps, ['', - '']) + ''], + transform=repr) WorkflowForTesting.register(StepThree) flow = WorkflowForTesting(req) self.assertQuerysetEqual(flow.steps, ['', '', - '']) + ''], + transform=repr) def test_workflow_unregister_unexisting_workflow(self): with self.assertRaises(base.NotRegistered): @@ -360,7 +363,8 @@ class WorkflowsTests(test.TestCase): ("horizon.test",)) self.assertQuerysetEqual(flow.steps, ['', - '']) + ''], + transform=repr) self.set_permissions(['test']) self.request.user = self.user @@ -368,7 +372,8 @@ class WorkflowsTests(test.TestCase): self.assertQuerysetEqual(flow.steps, ['', '', - '']) + ''], + transform=repr) def test_has_allowed(self): WorkflowForTesting.register(DisabledStep) @@ -377,7 +382,8 @@ class WorkflowsTests(test.TestCase): # even though DisabledStep is registered. self.assertQuerysetEqual(flow.steps, ['', - '']) + ''], + transform=repr) def test_step_is_hidden_on_policy(self): self.policy_patcher.stop() diff --git a/openstack_dashboard/dashboards/admin/aggregates/tests.py b/openstack_dashboard/dashboards/admin/aggregates/tests.py index 2eb825d7e1..6d1173259d 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/tests.py +++ b/openstack_dashboard/dashboards/admin/aggregates/tests.py @@ -52,7 +52,8 @@ class CreateAggregateWorkflowTests(BaseAggregateWorkflowTests): self.assertQuerysetEqual( workflow.steps, ['', - '']) + ''], + transform=repr) self.mock_service_list.assert_called_once_with( test.IsHttpRequest(), binary='nova-compute') diff --git a/openstack_dashboard/dashboards/admin/defaults/tests.py b/openstack_dashboard/dashboards/admin/defaults/tests.py index 259f8106f9..8ddfbb9a72 100644 --- a/openstack_dashboard/dashboards/admin/defaults/tests.py +++ b/openstack_dashboard/dashboards/admin/defaults/tests.py @@ -101,6 +101,7 @@ class ServicesViewTests(test.BaseAdminViewTests): quotas_tab = res.context['tab_group'].get_tab(slug) self.assertQuerysetEqual(quotas_tab._tables[slug].data, expected_data, + transform=repr, ordered=False) diff --git a/openstack_dashboard/dashboards/admin/flavors/tests.py b/openstack_dashboard/dashboards/admin/flavors/tests.py index 07ddef47bf..7da4eb0361 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tests.py +++ b/openstack_dashboard/dashboards/admin/flavors/tests.py @@ -254,7 +254,8 @@ class CreateFlavorWorkflowTests(BaseFlavorWorkflowTests): self.assertQuerysetEqual( workflow.steps, ['', - '']) + ''], + transform=repr) self.mock_tenant_list.assert_called_once_with(test.IsHttpRequest()) @test.create_mocks({api.keystone: ('tenant_list',), @@ -471,7 +472,8 @@ class UpdateFlavorWorkflowTests(BaseFlavorWorkflowTests): self.assertQuerysetEqual( workflow.steps, - ['']) + [''], + transform=repr) step = workflow.get_step("flavor_access") field_name = step.get_member_field_name('member') diff --git a/openstack_dashboard/dashboards/admin/info/tests.py b/openstack_dashboard/dashboards/admin/info/tests.py index fed5d001c3..0cec71c79c 100644 --- a/openstack_dashboard/dashboards/admin/info/tests.py +++ b/openstack_dashboard/dashboards/admin/info/tests.py @@ -76,7 +76,8 @@ class SystemInfoViewTests(test.BaseAdminViewTests): network_agents_tab = res.context['tab_group'].get_tab('network_agents') self.assertQuerysetEqual( network_agents_tab._tables['network_agents'].data, - [agent.__repr__() for agent in self.agents.list()] + [agent.__repr__() for agent in self.agents.list()], + transform=repr ) def test_cinder_index(self): @@ -85,5 +86,6 @@ class SystemInfoViewTests(test.BaseAdminViewTests): get_tab('cinder_services') self.assertQuerysetEqual( cinder_services_tab._tables['cinder_services'].data, - [service.__repr__() for service in self.cinder_services.list()] + [service.__repr__() for service in self.cinder_services.list()], + transform=repr ) diff --git a/openstack_dashboard/dashboards/identity/domains/tests.py b/openstack_dashboard/dashboards/identity/domains/tests.py index b07a171300..7b2ff3fc2c 100644 --- a/openstack_dashboard/dashboards/identity/domains/tests.py +++ b/openstack_dashboard/dashboards/identity/domains/tests.py @@ -202,7 +202,8 @@ class CreateDomainWorkflowTests(test.BaseAdminViewTests): workflows.CreateDomain.name) self.assertQuerysetEqual(workflow.steps, - ['', ]) + [''], + transform=repr) @test.create_mocks({api.keystone: ('domain_create', )}) def test_add_domain_post(self): @@ -300,7 +301,8 @@ class UpdateDomainWorkflowTests(test.BaseAdminViewTests): workflow.steps, ['', '', - '']) + ''], + transform=repr) self.mock_domain_get.assert_called_once_with(test.IsHttpRequest(), '1') self.assert_mock_multiple_calls_with_same_arguments( diff --git a/openstack_dashboard/dashboards/identity/projects/tests.py b/openstack_dashboard/dashboards/identity/projects/tests.py index 873895ac4c..635f981238 100644 --- a/openstack_dashboard/dashboards/identity/projects/tests.py +++ b/openstack_dashboard/dashboards/identity/projects/tests.py @@ -209,7 +209,8 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests): workflow.steps, ['', '', - '']) + ''], + transform=repr) self.mock_get_default_domain.assert_called_once_with( test.IsHttpRequest()) @@ -581,7 +582,8 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests): workflow.steps, ['', '', - '']) + ''], + transform=repr) self.mock_tenant_get.assert_called_once_with( test.IsHttpRequest(), self.tenant.id, admin=True) @@ -1009,7 +1011,8 @@ class UpdateQuotasWorkflowTests(test.BaseAdminViewTests): self.assertQuerysetEqual( workflow.steps, ['', - '']) + ''], + transform=repr) self.mock_get_disabled_quotas.assert_called_once_with( test.IsHttpRequest()) diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py index 70d32bc4b3..5ab1b4a489 100644 --- a/openstack_dashboard/dashboards/project/instances/tests.py +++ b/openstack_dashboard/dashboards/project/instances/tests.py @@ -2214,7 +2214,8 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin): 'Disk Partition') self.assertQuerysetEqual(workflow.steps, ['', - '']) + ''], + transform=repr) option = '' def is_original_flavor(server, flavor, nova_api_lt_2_47): diff --git a/openstack_dashboard/dashboards/project/networks/tests.py b/openstack_dashboard/dashboards/project/networks/tests.py index c6740589cf..d2cda4878f 100644 --- a/openstack_dashboard/dashboards/project/networks/tests.py +++ b/openstack_dashboard/dashboards/project/networks/tests.py @@ -387,7 +387,7 @@ class NetworkTests(test.TestCase, NetworkStubMixin): expected_objs = ['', '', ''] - self.assertQuerysetEqual(workflow.steps, expected_objs) + self.assertQuerysetEqual(workflow.steps, expected_objs, transform=repr) self._check_is_extension_supported({'network_availability_zone': 1, 'subnet_allocation': 1}) self.mock_subnetpool_list.assert_called_once_with(test.IsHttpRequest())