summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2019-01-15 23:39:23 -0600
committerTim Graham <timograham@gmail.com>2019-01-16 13:23:55 -0500
commitaa5d0a5a90a690dc6f8fdbbffba143e32c86e40a (patch)
tree4482a6d0ecd0b43a6d423541cf50ce1b07c27822 /tests
parent876dc306cd508a041ccc62cf87397514fce4c9f3 (diff)
Removed unnecessary transaction wrapping in expressions test.
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/tests.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index df92dba432..af432eb163 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -5,7 +5,7 @@ import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
-from django.db import DatabaseError, connection, models, transaction
+from django.db import DatabaseError, connection, models
from django.db.models import CharField, Q, TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, Max, Min, StdDev, Sum, Variance,
@@ -237,12 +237,11 @@ class BasicExpressionsTests(TestCase):
"foo",
)
- with transaction.atomic():
- msg = "Joined field references are not permitted in this query"
- with self.assertRaisesMessage(FieldError, msg):
- Company.objects.exclude(
- ceo__firstname=F('point_of_contact__firstname')
- ).update(name=F('point_of_contact__lastname'))
+ msg = "Joined field references are not permitted in this query"
+ with self.assertRaisesMessage(FieldError, msg):
+ Company.objects.exclude(
+ ceo__firstname=F('point_of_contact__firstname')
+ ).update(name=F('point_of_contact__lastname'))
def test_object_update(self):
# F expressions can be used to update attributes on single objects