summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/update/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/update/tests.py b/tests/update/tests.py
index 079e00818a..a365dc00c5 100644
--- a/tests/update/tests.py
+++ b/tests/update/tests.py
@@ -256,6 +256,13 @@ class AdvancedTests(TestCase):
Bar.objects.annotate(abs_id=Abs("m2m_foo")).order_by("-abs_id").update(x=4)
self.assertEqual(Bar.objects.get().x, 4)
+ def test_update_values_annotation(self):
+ RelatedPoint.objects.annotate(abs_id=Abs("id")).filter(
+ data__is_active=False
+ ).values("id", "abs_id").update(data=self.d0)
+ self.r1.refresh_from_db(fields=["data"])
+ self.assertEqual(self.r1.data, self.d0)
+
def test_update_negated_f(self):
DataPoint.objects.update(is_active=~F("is_active"))
self.assertCountEqual(