mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Refs #35520 -- Fixed expected query count in admin_views tests.
In 53e674d574
, the count should only
have been lowered for the case when savepoint are supported.
This commit is contained in:
parent
274f855f4a
commit
7e41a7a47d
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user