mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Refs #28897 -- Added test for QuerySet.update() on querysets ordered by inline m2m annotation.
This commit is contained in:
committed by
Mariusz Felisiak
parent
e286ce17ff
commit
f4680a112d
@@ -225,6 +225,13 @@ class AdvancedTests(TestCase):
|
||||
new_name=annotation,
|
||||
).update(name=F("new_name"))
|
||||
|
||||
def test_update_ordered_by_inline_m2m_annotation(self):
|
||||
foo = Foo.objects.create(target="test")
|
||||
Bar.objects.create(foo=foo)
|
||||
|
||||
Bar.objects.order_by(Abs("m2m_foo")).update(x=2)
|
||||
self.assertEqual(Bar.objects.get().x, 2)
|
||||
|
||||
|
||||
@unittest.skipUnless(
|
||||
connection.vendor == "mysql",
|
||||
|
||||
Reference in New Issue
Block a user