summaryrefslogtreecommitdiff
path: root/tests/auth_tests
diff options
context:
space:
mode:
authorantoliny0919 <antoliny0919@gmail.com>2025-03-27 08:43:57 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-03-27 13:27:33 +0100
commit849f8307a5bb33465252d0891a9b2c47dde65889 (patch)
treeb3f634892a41bc531a076bc2dcaa82350a355c9c /tests/auth_tests
parent9aabe7eae3eeb3e64c5a0f3687118cd806158550 (diff)
Fixed #34917 -- Underlined links in the main content area of the admin.
Diffstat (limited to 'tests/auth_tests')
-rw-r--r--tests/auth_tests/test_forms.py7
-rw-r--r--tests/auth_tests/test_views.py4
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
index 4740cb6200..0f8b48286a 100644
--- a/tests/auth_tests/test_forms.py
+++ b/tests/auth_tests/test_forms.py
@@ -1089,7 +1089,9 @@ class UserChangeFormTest(TestDataMixin, TestCase):
"Set password",
),
]
- password_reset_link = r'<a class="button" href="([^"]*)">([^<]*)</a>'
+ password_reset_link = (
+ r'<a role="button" class="button" href="([^"]*)">([^<]*)</a>'
+ )
for username, expected_help_text, expected_button_label in cases:
with self.subTest(username=username):
user = User.objects.get(username=username)
@@ -1438,7 +1440,8 @@ class ReadOnlyPasswordHashTest(SimpleTestCase):
" <strong>hash</strong>: "
" <bdi>WmCkn9**************************************</bdi>"
" </p>"
- ' <p><a class="button" href="../password/">Reset password</a></p>'
+ ' <p><a role="button" class="button" href="../password/">'
+ "Reset password</a></p>"
"</div>",
)
diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py
index 1583f8ffd7..156520ebf7 100644
--- a/tests/auth_tests/test_views.py
+++ b/tests/auth_tests/test_views.py
@@ -1532,7 +1532,7 @@ class ChangelistTests(MessagesTestMixin, AuthViewsTestCase):
response = self.client.get(user_change_url)
# Test the link inside password field help_text.
rel_link = re.search(
- r'<a class="button" href="([^"]*)">Reset password</a>',
+ r'<a role="button" class="button" href="([^"]*)">Reset password</a>',
response.text,
)[1]
self.assertEqual(urljoin(user_change_url, rel_link), password_change_url)
@@ -1628,7 +1628,7 @@ class ChangelistTests(MessagesTestMixin, AuthViewsTestCase):
response = self.client.get(user_change_url)
# Test the link inside password field help_text.
rel_link = re.search(
- r'<a class="button" href="([^"]*)">Set password</a>',
+ r'<a role="button" class="button" href="([^"]*)">Set password</a>',
response.text,
)[1]
self.assertEqual(urljoin(user_change_url, rel_link), password_change_url)