Fixed #17377 -- Don't depend on a warm cache in admin_views.UserAdminTest.test_user_permission_performance. Thanks Gregor Müllegger.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17199 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin 2011-12-11 12:04:37 +00:00
parent 694bc0f22b
commit 58276bd338
1 changed files with 3 additions and 1 deletions

View File

@ -2982,7 +2982,9 @@ class UserAdminTest(TestCase):
def test_user_permission_performance(self):
u = User.objects.all()[0]
with self.assertNumQueries(7):
# Don't depend on a warm cache, see #17377.
ContentType.objects.clear_cache()
with self.assertNumQueries(8):
response = self.client.get('/test_admin/admin/auth/user/%s/' % u.pk)
self.assertEqual(response.status_code, 200)