1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #31617 -- Added an id for helptext in admin forms.

This commit is contained in:
David Smith
2022-03-30 09:10:24 +01:00
committed by Carlton Gibson
parent 50e1e7ef8e
commit 6991880109
7 changed files with 76 additions and 19 deletions

View File

@@ -1523,7 +1523,7 @@ class ChangeListTests(TestCase):
request = self._mocked_authenticated_request("/band/", superuser)
response = m.changelist_view(request)
self.assertIsNone(response.context_data["cl"].search_help_text)
self.assertNotContains(response, '<div class="help">')
self.assertNotContains(response, '<div class="help id="searchbar_helptext">')
# search_fields with search_help_text.
m.search_help_text = "Search help text"
request = self._mocked_authenticated_request("/band/", superuser)
@@ -1531,7 +1531,14 @@ class ChangeListTests(TestCase):
self.assertEqual(
response.context_data["cl"].search_help_text, "Search help text"
)
self.assertContains(response, '<div class="help">Search help text</div>')
self.assertContains(
response, '<div class="help" id="searchbar_helptext">Search help text</div>'
)
self.assertContains(
response,
'<input type="text" size="40" name="q" value="" id="searchbar" '
'autofocus aria-describedby="searchbar_helptext">',
)
class GetAdminLogTests(TestCase):