diff options
| author | Tim Graham <timograham@gmail.com> | 2024-12-16 12:33:42 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-12-17 14:40:34 +0100 |
| commit | 7e41a7a47d0ee3e2d8270b04afbb908ece0b2b77 (patch) | |
| tree | 8b2ba846359f8f2ffb0621c68edcc6443594ad84 /tests | |
| parent | 274f855f4a275b56f89c2bf8d1101d4b2cddee4e (diff) | |
Refs #35520 -- Fixed expected query count in admin_views tests.
In 53e674d5744faad61e52d8459c9198b2aa6f63dd, the count should only
have been lowered for the case when savepoint are supported.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_views/tests.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 1ff29fc3db..8e2c55804b 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -24,7 +24,6 @@ from django.contrib.contenttypes.models import ContentType from django.core import mail from django.core.checks import Error from django.core.files import temp as tempfile -from django.db import connection from django.forms.utils import ErrorList from django.template.response import TemplateResponse from django.test import ( @@ -7477,8 +7476,7 @@ class UserAdminTest(TestCase): # Don't depend on a warm cache, see #17377. ContentType.objects.clear_cache() - expected_num_queries = 8 if connection.features.uses_savepoints else 6 - with self.assertNumQueries(expected_num_queries): + with self.assertNumQueries(8): response = self.client.get(reverse("admin:auth_user_change", args=(u.pk,))) self.assertEqual(response.status_code, 200) @@ -7525,8 +7523,7 @@ class GroupAdminTest(TestCase): # Ensure no queries are skipped due to cached content type for Group. ContentType.objects.clear_cache() - expected_num_queries = 6 if connection.features.uses_savepoints else 4 - with self.assertNumQueries(expected_num_queries): + with self.assertNumQueries(6): response = self.client.get(reverse("admin:auth_group_change", args=(g.pk,))) self.assertEqual(response.status_code, 200) |
