MCPcopy
hub / github.com/django/django / test_group_permission_performance

Method test_group_permission_performance

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

Source from the content-addressed store, hash-verified

8261 self.assertEqual(Group.objects.count(), group_count + 1)
8262
8263 def test_group_permission_performance(self):
8264 g = Group.objects.create(name="test_group")
8265
8266 # Ensure no queries are skipped due to cached content type for Group.
8267 ContentType.objects.clear_cache()
8268
8269 with self.assertNumQueries(6):
8270 response = self.client.get(reverse("admin:auth_group_change", args=(g.pk,)))
8271 self.assertEqual(response.status_code, 200)
8272
8273
8274@override_settings(ROOT_URLCONF="admin_views.urls")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected