Skip to content

Commit

Permalink
replace all btn generte by admin_action_button. testcase changed
Browse files Browse the repository at this point in the history
  • Loading branch information
FreemanPancake committed Nov 6, 2024
1 parent a190cf4 commit 0ce6923
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Unreleased
==========
* Dropped support for Django < 4.2
* Dropped support for Django CMS < 4.1
* Add suppor for Django CMS 4.1
* Add support for Django CMS 4.1
* Added support for Python 3.11

1.7.1 (2024-06-06)
Expand Down
30 changes: 15 additions & 15 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def test_duplicate_link(self):
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-duplicate"})
element = soup.find("a", {"class": "cms-action-duplicate"})
self.assertIsNotNone(
element, "Missing a.cms-page-admin-action-duplicate element"
element, "Missing a.cms-action-duplicate element"
)
self.assertEqual(element["title"], "Duplicate")
self.assertEqual(
Expand All @@ -156,7 +156,7 @@ def test_set_home_link(self):
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-set-home"})
element = soup.find("a", {"class": "cms-action-set-home"})
self.assertEqual(element["title"], "Set as a home")
self.assertEqual(
element["href"],
Expand All @@ -169,9 +169,9 @@ def test_unpublish_link(self):
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-unpublish"})
element = soup.find("a", {"class": "cms-action-unpublish"})
self.assertIsNotNone(
element, "Missing a.cms-page-admin-action-unpublish element"
element, "Missing a.cms-action-unpublish element"
)
self.assertEqual(element["title"], "Unpublish")

Expand All @@ -186,20 +186,20 @@ def test_unpublish_not_shown(self):
# element,
# "Element a.cms-action-unpublish is shown when it shouldn't",
# )
element = soup.find("a", {"class": "cms-page-admin-action-unpublish"})
element = soup.find("a", {"class": "cms-action-unpublish"})
self.assertIsNone(
element,
"Element a.cms-page-admin-action-unpublish is shown when it shouldn't",
"Element a.cms-action-unpublish is shown when it shouldn't",
)

def test_manage_versions_link(self):
pagecontent = PageContentWithVersionFactory()
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-manage-versions"})
element = soup.find("a", {"class": "cms-action-manage-versions"})
self.assertIsNotNone(
element, "Missing a.cms-page-admin-action-manage-versions element"
element, "Missing a.cms-action-manage-versions element"
)
self.assertEqual(element["title"], "Manage versions")
self.assertEqual(element["href"], version_list_url(pagecontent))
Expand All @@ -209,9 +209,9 @@ def test_basic_settings_link(self):
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-basic-settings"})
element = soup.find("a", {"class": "cms-action-basic-settings"})
self.assertIsNotNone(
element, "Missing a.cms-page-admin-action-basic-settings element"
element, "Missing a.cms-action-basic-settings element"
)
self.assertEqual(element["title"], "Basic settings")
self.assertEqual(
Expand All @@ -224,9 +224,9 @@ def test_advanced_settings_link(self):
func = self.modeladmin._list_actions(self.get_request("/"))
response = func(pagecontent)
soup = parse_html(response)
element = soup.find("a", {"class": "cms-page-admin-action-advanced-settings"})
element = soup.find("a", {"class": "cms-action-advanced-settings"})
self.assertIsNotNone(
element, "Missing a.cms-page-admin-action-advanced-settings element"
element, "Missing a.cms-action-advanced-settings element"
)
self.assertEqual(element["title"], "Advanced settings")
self.assertEqual(
Expand Down Expand Up @@ -513,8 +513,8 @@ def test_changelist_url_link_doesnt_open_in_sideframe(self):
url_markup = self.modeladmin.url(pagecontent)

# The url link should close the sideframe when selected
self.assertIn("js-page-admin-close-sideframe", url_markup)
self.assertNotIn("js-page-admin-keep-sideframe", url_markup)
self.assertIn("js-close-sideframe", url_markup)
self.assertNotIn("js-keep-sideframe", url_markup)

def test_preview_link_doesnt_open_in_sideframe(self):
"""
Expand Down

0 comments on commit 0ce6923

Please sign in to comment.