summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2022-12-02 13:57:40 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-02 13:58:46 +0100
commiteccda63a49b92ab14d523d69da2a3b3246cf91d1 (patch)
treedcfa34f9076f5d1bb46fb0d893fecaeef6f1deb6 /tests/postgres_tests
parent3e3b7f691b5cc41c357966ce3f91a8d13c6c1d4d (diff)
Improved isolation of TestGeneralAggregate.test_default_argument().
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_aggregates.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/postgres_tests/test_aggregates.py b/tests/postgres_tests/test_aggregates.py
index 183cff10c9..b5474d361e 100644
--- a/tests/postgres_tests/test_aggregates.py
+++ b/tests/postgres_tests/test_aggregates.py
@@ -1,4 +1,4 @@
-from django.db import connection
+from django.db import connection, transaction
from django.db.models import (
CharField,
F,
@@ -147,7 +147,7 @@ class TestGeneralAggregate(PostgreSQLTestCase):
)
self.assertEqual(values, {"aggregation": expected_result})
# Empty result when query must be executed.
- with self.assertNumQueries(1):
+ with transaction.atomic(), self.assertNumQueries(1):
values = AggregateTestModel.objects.aggregate(
aggregation=aggregation,
)