def test_settings(self): toolbars = toolbar_pool.toolbars toolbar_pool.clear() with SettingsOverride(CMS_TOOLBARS=['cms.cms_toolbar.BasicToolbar', 'cms.cms_toolbar.PlaceholderToolbar']): toolbar_pool.register(TestToolbar) self.assertEqual(len(list(self.pool.get_toolbars().keys())), 2) api.create_page("home", "simple.html", "en", published=True) with self.login_user_context(self.get_superuser()): response = self.client.get("/en/?edit") self.assertEqual(response.status_code, 200) toolbar_pool.toolbars = toolbars
def test_settings(self): toolbars = toolbar_pool.toolbars toolbar_pool.clear() with self.settings(CMS_TOOLBARS=['cms.cms_toolbar.BasicToolbar', 'cms.cms_toolbar.PlaceholderToolbar']): toolbar_pool.register(TestToolbar) self.assertEqual(len(list(self.pool.get_toolbars().keys())), 2) api.create_page("home", "simple.html", "en", published=True) with self.login_user_context(self.get_superuser()): 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_settings(self): pool = ToolbarPool() toolbars = toolbar_pool.toolbars toolbar_pool.clear() with self.settings(CMS_TOOLBARS=['cms.cms_toolbars.BasicToolbar', 'cms.cms_toolbars.PlaceholderToolbar']): toolbar_pool.register(TestToolbar) self.assertEqual(len(list(pool.get_toolbars().keys())), 2) api.create_page("home", "simple.html", "en", published=True) with self.login_user_context(self.get_superuser()): 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_settings(self): pool = ToolbarPool() toolbars = toolbar_pool.toolbars toolbar_pool.clear() with self.settings(CMS_TOOLBARS=[ 'cms.cms_toolbars.BasicToolbar', 'cms.cms_toolbars.PlaceholderToolbar' ]): toolbar_pool.register(TestToolbar) self.assertEqual(len(list(pool.get_toolbars().keys())), 2) page = api.create_page("home", "simple.html", "en", published=True) page_edit_url_on = self.get_edit_on_url(page.get_absolute_url()) with self.login_user_context(self.get_superuser()): response = self.client.get(page_edit_url_on) self.assertEqual(response.status_code, 200) toolbar_pool.toolbars = toolbars