diff options
author | sarahboyce <sarahvboyce95@gmail.com> | 2023-03-02 20:06:33 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-03-03 10:18:15 +0100 |
commit | 50ca4defcb2e5d1c987ed006562f7a812179b3df (patch) | |
tree | 7e24b9f96ffbafdd1fae77146d97b57ecd7229ac /tests/admin_changelist | |
parent | 52e54860bf9e7b84e312a8f4edfcdcfc164592cb (diff) | |
download | django-50ca4defcb2e5d1c987ed006562f7a812179b3df.tar.gz |
Added test for preserving popup by reset link in the admin changelist.
Diffstat (limited to 'tests/admin_changelist')
-rw-r--r-- | tests/admin_changelist/tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index c603f15298..3897453cda 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -1593,6 +1593,19 @@ class ChangeListTests(TestCase): '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): def test_custom_user_pk_not_named_id(self): |