diff --git a/tests/test_admin.py b/tests/test_admin.py index 084a4281f..d8367be44 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -2085,9 +2085,14 @@ def test_menucontent_changelist_url_link_opens_in_sideframe(self): request.menu_content_id = menucontent.pk url_markup = self.menucontent_modeladmin._get_edit_link(menucontent, request) - # The url link should keep the sideframe close - self.assertNotIn("js-keep-sideframe", url_markup) - self.assertIn("js-close-sideframe", url_markup) + if CMS_41: + # The url link should keep the sideframe close + self.assertNotIn("js-keep-sideframe", url_markup) + self.assertIn("js-close-sideframe", url_markup) + else: + # The url link should keep the sideframe open + self.assertIn("js-versioning-keep-sideframe", url_markup) + self.assertNotIn("js-versioning-close-sideframe", url_markup) def test_menucontent_preview_link_opens_in_sideframe(self): """ @@ -2100,9 +2105,14 @@ def test_menucontent_preview_link_opens_in_sideframe(self): request.menu_content_id = menucontent.pk url_markup = self.menucontent_modeladmin._get_preview_link(menucontent, request) - # The url link should keep the sideframe close - self.assertNotIn("js-keep-sideframe", url_markup) - self.assertIn("js-close-sideframe", url_markup) + if CMS_41: + # The url link should keep the sideframe close + self.assertNotIn("js-keep-sideframe", url_markup) + self.assertIn("js-close-sideframe", url_markup) + else: + # The url link should keep the sideframe open + self.assertIn("js-versioning-keep-sideframe", url_markup) + self.assertNotIn("js-versioning-close-sideframe", url_markup) def test_menuitem_changelist_edit_url_link_opens_in_sideframe(self): """ @@ -2117,9 +2127,14 @@ def test_menuitem_changelist_edit_url_link_opens_in_sideframe(self): request.menu_content_id = menucontent.pk url_markup = self.menuitem_modeladmin._get_edit_link(child, request) - # The url link should keep the sideframe close - self.assertNotIn("js-keep-sideframe", url_markup) - self.assertIn("js-close-sideframe", url_markup) + if CMS_41: + # The url link should keep the sideframe close + self.assertNotIn("js-keep-sideframe", url_markup) + self.assertIn("js-close-sideframe", url_markup) + else: + # The url link should keep the sideframe open + self.assertIn("js-versioning-keep-sideframe", url_markup) + self.assertNotIn("js-versioning-close-sideframe", url_markup) def test_menuitem_changelist_delete_url_link_opens_in_sideframe(self): """ @@ -2134,9 +2149,14 @@ def test_menuitem_changelist_delete_url_link_opens_in_sideframe(self): request.menu_content_id = menucontent.pk url_markup = self.menuitem_modeladmin._get_delete_link(child, request) - # The url link should keep the sideframe close - self.assertIn("js-keep-sideframe", url_markup) - self.assertNotIn("js-close-sideframe", url_markup) + if CMS_41: + # The url link should keep the sideframe close + self.assertNotIn("js-keep-sideframe", url_markup) + self.assertIn("js-close-sideframe", url_markup) + else: + # The url link should keep the sideframe open + self.assertIn("js-versioning-keep-sideframe", url_markup) + self.assertNotIn("js-versioning-close-sideframe", url_markup) class ReferencesIntegrationTestCase(CMSTestCase):