From 7cd3f1c29595d1da7f37d29e7c3bc6a7a314cd1d Mon Sep 17 00:00:00 2001 From: wrwrwr Date: Mon, 24 Nov 2014 20:10:23 +0100 Subject: [PATCH] Fixed cache state dependence for assertNumQueries in test_group_permission_performance. Refs #20432 and #23746. --- tests/admin_views/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 0aec7a052fa..f55bcacd782 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -4205,6 +4205,10 @@ class GroupAdminTest(TestCase): def test_group_permission_performance(self): g = Group.objects.create(name="test_group") + + # Ensure no queries are skipped due to cached content type for Group. + ContentType.objects.clear_cache() + with self.assertNumQueries(8): response = self.client.get('/test_admin/admin/auth/group/%s/' % g.pk) self.assertEqual(response.status_code, 200)