MCPcopy
hub / github.com/django/django / test_user_permission_performance

Method test_user_permission_performance

tests/admin_views/tests.py:8216–8224  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8214 self.assertTrue(new_user.has_usable_password())
8215
8216 def test_user_permission_performance(self):
8217 u = User.objects.all()[0]
8218
8219 # Don't depend on a warm cache, see #17377.
8220 ContentType.objects.clear_cache()
8221
8222 with self.assertNumQueries(8):
8223 response = self.client.get(reverse("admin:auth_user_change", args=(u.pk,)))
8224 self.assertEqual(response.status_code, 200)
8225
8226 def test_form_url_present_in_context(self):
8227 u = User.objects.all()[0]

Callers

nothing calls this directly

Calls 5

reverseFunction · 0.90
assertNumQueriesMethod · 0.80
allMethod · 0.45
clear_cacheMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected