diff options
| author | antoliny0919 <antoliny0919@gmail.com> | 2025-03-27 08:43:57 +0100 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-03-27 13:27:33 +0100 |
| commit | 849f8307a5bb33465252d0891a9b2c47dde65889 (patch) | |
| tree | b3f634892a41bc531a076bc2dcaa82350a355c9c /tests/admin_views/tests.py | |
| parent | 9aabe7eae3eeb3e64c5a0f3687118cd806158550 (diff) | |
Fixed #34917 -- Underlined links in the main content area of the admin.
Diffstat (limited to 'tests/admin_views/tests.py')
| -rw-r--r-- | tests/admin_views/tests.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index feafde47fd..b79b4a94a4 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -2683,8 +2683,8 @@ class AdminViewPermissionsTest(TestCase): self.assertContains(response, "<label>Extra form field:</label>") self.assertContains( response, - '<a href="/test_admin/admin/admin_views/article/" class="closelink">Close' - "</a>", + '<a role="button" href="/test_admin/admin/admin_views/article/" ' + 'class="closelink">Close</a>', ) self.assertEqual(response.context["title"], "View article") post = self.client.post(article_change_url, change_dict) @@ -2835,8 +2835,8 @@ class AdminViewPermissionsTest(TestCase): self.assertContains(response, "<h1>View article</h1>") self.assertContains( response, - '<a href="/test_admin/admin9/admin_views/article/" class="closelink">Close' - "</a>", + '<a role="button" href="/test_admin/admin9/admin_views/article/" ' + 'class="closelink">Close</a>', ) def test_change_view_save_as_new(self): @@ -4056,7 +4056,8 @@ class AdminViewStringPrimaryKeyTest(TestCase): args=(quote(self.pk),), ) self.assertContains( - response, '<a href="%s" class="historylink"' % escape(expected_link) + response, + '<a role="button" href="%s" class="historylink"' % escape(expected_link), ) def test_redirect_on_add_view_continue_button(self): @@ -8313,13 +8314,14 @@ class AdminKeepChangeListFiltersTests(TestCase): # Check the history link. history_link = re.search( - '<a href="(.*?)" class="historylink">History</a>', response.text + '<a role="button" href="(.*?)" class="historylink">History</a>', + response.text, ) self.assertURLEqual(history_link[1], self.get_history_url()) # Check the delete link. delete_link = re.search( - '<a href="(.*?)" class="deletelink">Delete</a>', response.text + '<a role="button" href="(.*?)" class="deletelink">Delete</a>', response.text ) self.assertURLEqual(delete_link[1], self.get_delete_url()) @@ -8359,7 +8361,7 @@ class AdminKeepChangeListFiltersTests(TestCase): self.client.force_login(viewuser) response = self.client.get(self.get_change_url()) close_link = re.search( - '<a href="(.*?)" class="closelink">Close</a>', response.text + '<a role="button" href="(.*?)" class="closelink">Close</a>', response.text ) close_link = close_link[1].replace("&", "&") self.assertURLEqual(close_link, self.get_changelist_url()) |
