diff --git a/cms/test_utils/project/placeholderapp/cms_toolbar.py b/cms/test_utils/project/placeholderapp/cms_toolbar.py index 7a680aa6a25..daee6a9aa19 100644 --- a/cms/test_utils/project/placeholderapp/cms_toolbar.py +++ b/cms/test_utils/project/placeholderapp/cms_toolbar.py @@ -12,7 +12,7 @@ @toolbar_pool.register class Example1Toolbar(CMSToolbar): - watch_models = [Example1, CharPksExample] + watch_models = (Example1, CharPksExample) def populate(self): admin_menu = self.toolbar.get_or_create_menu(ADMIN_MENU_IDENTIFIER) diff --git a/cms/tests/toolbar_pool.py b/cms/tests/toolbar_pool.py index 2ef0de21ea6..83a3a589726 100644 --- a/cms/tests/toolbar_pool.py +++ b/cms/tests/toolbar_pool.py @@ -60,3 +60,7 @@ def test_settings(self): response = self.client.get("/en/?%s" % get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON')) self.assertEqual(response.status_code, 200) toolbar_pool.toolbars = toolbars + + def test_watch_models(self): + toolbar_pool.discover_toolbars() + self.assertEqual(type(toolbar_pool.get_watch_models()), list) diff --git a/cms/toolbar_pool.py b/cms/toolbar_pool.py index 55b669bd50a..93957938933 100644 --- a/cms/toolbar_pool.py +++ b/cms/toolbar_pool.py @@ -55,7 +55,7 @@ def get_toolbars(self): return self.toolbars def get_watch_models(self): - return sum((getattr(tb, 'watch_models', []) + return sum((list(getattr(tb, 'watch_models', [])) for tb in self.toolbars.values()), [])