summaryrefslogtreecommitdiff
path: root/tests/admin_views/tests.py
diff options
context:
space:
mode:
authorNick Sandford <nick@sandford.id.au>2015-11-07 13:01:25 +0000
committerTim Graham <timograham@gmail.com>2015-11-18 19:54:27 -0500
commit5fa7b592b3f43282823045954c61a1f9a4b31a7f (patch)
treed104e79418b9f49bdef5426a7d1fb984ca514d9e /tests/admin_views/tests.py
parentad167502f36f2547718aee290d4d11bf7a26ff82 (diff)
Fixed #22810 -- Corrected admin changelist count for list filters that filter by default.
Diffstat (limited to 'tests/admin_views/tests.py')
-rw-r--r--tests/admin_views/tests.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index b6db228809..ba81860db6 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -3756,13 +3756,12 @@ class AdminCustomQuerysetTest(TestCase):
Person.objects.create(name='person2', gender=2)
changelist_url = reverse('admin:admin_views_person_changelist')
- # 4 queries are expected: 1 for the session, 1 for the user,
- # 1 for the count and 1 for the objects on the page
- with self.assertNumQueries(4):
+ # 5 queries are expected: 1 for the session, 1 for the user,
+ # 2 for the counts and 1 for the objects on the page
+ with self.assertNumQueries(5):
resp = self.client.get(changelist_url)
self.assertEqual(resp.context['selection_note'], '0 of 2 selected')
self.assertEqual(resp.context['selection_note_all'], 'All 2 selected')
- # here one more count(*) query will run, because filters were applied
with self.assertNumQueries(5):
extra = {'q': 'not_in_name'}
resp = self.client.get(changelist_url, extra)