mirror of
https://github.com/django/django.git
synced 2025-01-03 15:06:09 +00:00
Improved isolation of TestGeneralAggregate.test_default_argument().
This commit is contained in:
parent
3e3b7f691b
commit
eccda63a49
@ -1,4 +1,4 @@
|
|||||||
from django.db import connection
|
from django.db import connection, transaction
|
||||||
from django.db.models import (
|
from django.db.models import (
|
||||||
CharField,
|
CharField,
|
||||||
F,
|
F,
|
||||||
@ -147,7 +147,7 @@ class TestGeneralAggregate(PostgreSQLTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(values, {"aggregation": expected_result})
|
self.assertEqual(values, {"aggregation": expected_result})
|
||||||
# Empty result when query must be executed.
|
# Empty result when query must be executed.
|
||||||
with self.assertNumQueries(1):
|
with transaction.atomic(), self.assertNumQueries(1):
|
||||||
values = AggregateTestModel.objects.aggregate(
|
values = AggregateTestModel.objects.aggregate(
|
||||||
aggregation=aggregation,
|
aggregation=aggregation,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user