summaryrefslogtreecommitdiff
path: root/tests/distinct_on_fields/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/distinct_on_fields/tests.py')
-rw-r--r--tests/distinct_on_fields/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/distinct_on_fields/tests.py b/tests/distinct_on_fields/tests.py
index 93b3f27aec..f03e05ac73 100644
--- a/tests/distinct_on_fields/tests.py
+++ b/tests/distinct_on_fields/tests.py
@@ -178,3 +178,9 @@ class DistinctOnTests(TestCase):
.order_by("nAmEAlIaS")
)
self.assertSequenceEqual(qs, [self.p1_o1, self.p2_o1, self.p3_o1])
+
+ def test_disallowed_update_distinct_on(self):
+ qs = Staff.objects.distinct("organisation").order_by("organisation")
+ msg = "Cannot call update() after .distinct(*fields)."
+ with self.assertRaisesMessage(TypeError, msg):
+ qs.update(name="p4")