1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Added test for preserving popup by reset link in the admin changelist.

This commit is contained in:
sarahboyce 2023-03-02 20:06:33 +01:00 committed by Mariusz Felisiak
parent 52e54860bf
commit 50ca4defcb

View File

@ -1593,6 +1593,19 @@ class ChangeListTests(TestCase):
'aria-describedby="searchbar_helptext">', 'aria-describedby="searchbar_helptext">',
) )
def test_search_bar_total_link_preserves_options(self):
self.client.force_login(self.superuser)
url = reverse("admin:auth_user_changelist")
for data, href in (
({"is_staff__exact": "0"}, "?"),
({"is_staff__exact": "0", IS_POPUP_VAR: "1"}, f"?{IS_POPUP_VAR}=1"),
):
with self.subTest(data=data):
response = self.client.get(url, data=data)
self.assertContains(
response, f'0 results (<a href="{href}">1 total</a>)'
)
class GetAdminLogTests(TestCase): class GetAdminLogTests(TestCase):
def test_custom_user_pk_not_named_id(self): def test_custom_user_pk_not_named_id(self):