mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #35520 -- Avoided opening transaction for read-only ModelAdmin requests.
This commit is contained in:
parent
31837dbcb3
commit
53e674d574
5 changed files with 104 additions and 6 deletions
|
|
@ -7385,7 +7385,7 @@ class UserAdminTest(TestCase):
|
|||
# Don't depend on a warm cache, see #17377.
|
||||
ContentType.objects.clear_cache()
|
||||
|
||||
expected_num_queries = 10 if connection.features.uses_savepoints else 8
|
||||
expected_num_queries = 8 if connection.features.uses_savepoints else 6
|
||||
with self.assertNumQueries(expected_num_queries):
|
||||
response = self.client.get(reverse("admin:auth_user_change", args=(u.pk,)))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
|
@ -7433,7 +7433,7 @@ class GroupAdminTest(TestCase):
|
|||
# Ensure no queries are skipped due to cached content type for Group.
|
||||
ContentType.objects.clear_cache()
|
||||
|
||||
expected_num_queries = 8 if connection.features.uses_savepoints else 6
|
||||
expected_num_queries = 6 if connection.features.uses_savepoints else 4
|
||||
with self.assertNumQueries(expected_num_queries):
|
||||
response = self.client.get(reverse("admin:auth_group_change", args=(g.pk,)))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue