diff --git a/horizon/tables/base.py b/horizon/tables/base.py index 2eb1ae5c71..f3770f1bcd 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -1922,7 +1922,7 @@ class DataTable(object, metaclass=DataTableMetaclass): def get_columns(self): """Returns this table's columns including auto-generated ones.""" - return self.columns.values() + return list(self.columns.values()) def get_rows(self): """Return the row data for this table broken out by columns.""" diff --git a/horizon/test/unit/tables/test_tables.py b/horizon/test/unit/tables/test_tables.py index 5711250ffa..422767e999 100644 --- a/horizon/test/unit/tables/test_tables.py +++ b/horizon/test/unit/tables/test_tables.py @@ -425,7 +425,7 @@ class DataTableTests(test.TestCase): # but should not contain the excluded column. # Additionally, auto-generated columns should use the custom # column class specified on the table. - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '', '', @@ -434,7 +434,7 @@ class DataTableTests(test.TestCase): '', '']) # Actions (these also test ordering) - self.assertQuerysetEqual(self.table.base_actions.values(), + self.assertQuerysetEqual(list(self.table.base_actions.values()), ['', '', '', @@ -472,7 +472,7 @@ 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.columns.values(), expected_columns) + self.assertQuerysetEqual(self.table.get_columns(), expected_columns) @override_settings(POLICY_CHECK_FUNCTION=lambda *args: True) def test_table_column_policy_allowed(self): @@ -480,7 +480,7 @@ 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.columns.values(), expected_columns) + self.assertQuerysetEqual(self.table.get_columns(), expected_columns) def test_table_force_no_multiselect(self): class TempTable(MyTable): @@ -490,7 +490,7 @@ class DataTableTests(test.TestCase): row_actions = (MyAction, MyLinkAction,) multi_select = False self.table = TempTable(self.request, TEST_DATA) - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '']) @@ -502,7 +502,7 @@ class DataTableTests(test.TestCase): row_actions = (MyAction, MyLinkAction,) actions_column = False self.table = TempTable(self.request, TEST_DATA) - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '']) @@ -528,7 +528,7 @@ class DataTableTests(test.TestCase): columns = ('id',) table_actions = (MyFilterAction, MyAction, MyBatchAction) self.table = TempTable(self.request, TEST_DATA) - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '']) @@ -538,7 +538,7 @@ class DataTableTests(test.TestCase): columns = ('id',) row_actions = (MyAction, MyLinkAction,) self.table = TempTable(self.request, TEST_DATA) - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '']) @@ -552,7 +552,7 @@ class DataTableTests(test.TestCase): row_actions = (MyAction, MyLinkAction,) self.table = TempTable(self.request, TEST_DATA) - self.assertQuerysetEqual(self.table.columns.values(), + self.assertQuerysetEqual(self.table.get_columns(), ['', '', '', diff --git a/horizon/test/unit/test_base.py b/horizon/test/unit/test_base.py index 1c54d2d9cd..6e066f5c2f 100644 --- a/horizon/test/unit/test_base.py +++ b/horizon/test/unit/test_base.py @@ -210,11 +210,11 @@ class HorizonTests(BaseHorizonTests): # Test registering a module with a dashboard that defines panels # as a panel group. cats.register(MyPanel) - self.assertQuerysetEqual(cats.get_panel_groups()['other'], + self.assertQuerysetEqual(list(cats.get_panel_groups()['other']), ['']) # Test that panels defined as a tuple still return a PanelGroup dogs = horizon.get_dashboard("dogs") - self.assertQuerysetEqual(dogs.get_panel_groups().values(), + self.assertQuerysetEqual(list(dogs.get_panel_groups().values()), ['']) # Test registering a module with a dashboard that defines panels