mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #36683 -- Added error message on QuerySet.update() following distinct(*fields).
This commit is contained in:
committed by
Jacob Walls
parent
3ff32c50d1
commit
4744e9939b
@@ -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")
|
||||
|
Reference in New Issue
Block a user