summaryrefslogtreecommitdiff
path: root/tests/expressions/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expressions/tests.py')
-rw-r--r--tests/expressions/tests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index af432eb163..e66dcd6297 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -24,8 +24,8 @@ from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
from django.test.utils import Approximate
from .models import (
- UUID, UUIDPK, Company, Employee, Experiment, Number, Result, SimulationRun,
- Time,
+ UUID, UUIDPK, Company, Employee, Experiment, Number, RemoteEmployee,
+ Result, SimulationRun, Time,
)
@@ -285,6 +285,11 @@ class BasicExpressionsTests(TestCase):
with self.assertRaisesMessage(FieldError, msg):
test_gmbh.save()
+ def test_update_inherited_field_value(self):
+ msg = 'Joined field references are not permitted in this query'
+ with self.assertRaisesMessage(FieldError, msg):
+ RemoteEmployee.objects.update(adjusted_salary=F('salary') * 5)
+
def test_object_update_unsaved_objects(self):
# F expressions cannot be used to update attributes on objects which do
# not yet exist in the database