Skip to content

Commit

Permalink
change assertion from -versioning to standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreemanPancake committed Oct 29, 2024
1 parent f02ed8b commit 18f1099
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ def test_list_display_without_version_locking(self):
list_display[0:4],
["title", "get_author", "get_modified_date", "get_versioning_state"]
)
self.assertIn("cms-versioning-action-btn", list_display[-1])
self.assertIn("cms-action-btn", list_display[-1])
# The preview button is present
self.assertIn("cms-versioning-action-preview", list_display[-1])
self.assertIn("cms-action-preview", list_display[-1])
# The edit button is present
self.assertIn("cms-versioning-action-edit", list_display[-1])
self.assertIn("cms-action-edit", list_display[-1])
self.assertIn("cms-form-get-method", list_display[-1])
self.assertIn("js-versioning-action", list_display[-1])
self.assertIn("js-versioning-keep-sideframe", list_display[-1])
self.assertIn("js-action", list_display[-1])
self.assertIn("js-keep-sideframe", list_display[-1])

@override_settings(DJANGOCMS_NAVIGATION_VERSIONING_ENABLED=False)
@disable_versioning_for_navigation()
Expand Down Expand Up @@ -1992,7 +1992,7 @@ def test_preview_link(self):
func = self.modeladmin._list_actions(self.get_request("/admin"))
response = func(menu_content)

self.assertIn("cms-versioning-action-preview", response)
self.assertIn("cms-action-preview", response)
self.assertIn('title="Preview"', response)
self.assertIn(preview_endpoint, response)

Expand All @@ -2007,7 +2007,7 @@ def test_edit_link(self):
edit_endpoint = reverse("admin:djangocms_versioning_menucontentversion_edit_redirect", args=(version.pk,),)
response = func(menu_content)

self.assertIn("cms-versioning-action-btn", response)
self.assertIn("cms-action-btn", response)
self.assertIn('title="Edit"', response)
self.assertIn(edit_endpoint, response)

Expand All @@ -2031,7 +2031,7 @@ def test_edit_link_not_shown(self):

response = func(version.content)

self.assertNotIn("cms-versioning-action-edit ", response)
self.assertNotIn("cms-action-edit ", response)


class MenuItemListActionsTestCase(CMSTestCase):
Expand All @@ -2051,7 +2051,7 @@ def test_edit_link(self):
)
response = func(menu_content.root)

self.assertIn("cms-versioning-action-btn", response)
self.assertIn("cms-action-btn", response)
self.assertIn('title="Edit"', response)
self.assertIn(edit_endpoint, response)

Expand All @@ -2072,9 +2072,9 @@ 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 open
self.assertIn("js-versioning-keep-sideframe", url_markup)
self.assertNotIn("js-versioning-close-sideframe", url_markup)
# The url link should keep the sideframe close
self.assertNotIn("js-keep-sideframe", url_markup)
self.assertIn("js-close-sideframe", url_markup)

def test_menucontent_preview_link_opens_in_sideframe(self):
"""
Expand All @@ -2087,9 +2087,9 @@ 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 open
self.assertIn("js-versioning-keep-sideframe", url_markup)
self.assertNotIn("js-versioning-close-sideframe", url_markup)
# The url link should keep the sideframe close
self.assertNotIn("js-keep-sideframe", url_markup)
self.assertIn("js-close-sideframe", url_markup)

def test_menuitem_changelist_edit_url_link_opens_in_sideframe(self):
"""
Expand All @@ -2104,9 +2104,9 @@ 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 open
self.assertIn("js-versioning-keep-sideframe", url_markup)
self.assertNotIn("js-versioning-close-sideframe", url_markup)
# The url link should keep the sideframe close
self.assertNotIn("js-keep-sideframe", url_markup)
self.assertIn("js-close-sideframe", url_markup)

def test_menuitem_changelist_delete_url_link_opens_in_sideframe(self):
"""
Expand All @@ -2121,9 +2121,9 @@ 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 open
self.assertIn("js-versioning-keep-sideframe", url_markup)
self.assertNotIn("js-versioning-close-sideframe", url_markup)
# The url link should keep the sideframe close
self.assertIn("js-keep-sideframe", url_markup)
self.assertNotIn("js-close-sideframe", url_markup)


class ReferencesIntegrationTestCase(CMSTestCase):
Expand Down

0 comments on commit 18f1099

Please sign in to comment.