summaryrefslogtreecommitdiff
path: root/tests/update/tests.py
diff options
context:
space:
mode:
authorRyan P Kilby <kilbyr@gmail.com>2025-09-04 09:24:33 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2025-09-04 12:15:45 -0400
commit11c2c9ac17db1c04c6de302167d4b0a5539c90fd (patch)
tree45d96e00cf8443de2949d1fd38044622bc6b8805 /tests/update/tests.py
parent34bd3ed944bf38792c631b55e581963d44d52284 (diff)
Refs #36481 -- Improved test coverage for invalid updates on reverse relations.
Diffstat (limited to 'tests/update/tests.py')
-rw-r--r--tests/update/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/update/tests.py b/tests/update/tests.py
index bbff0e4ff4..fdd0631142 100644
--- a/tests/update/tests.py
+++ b/tests/update/tests.py
@@ -165,6 +165,14 @@ class AdvancedTests(TestCase):
with self.assertRaisesMessage(FieldError, msg):
Bar.objects.update(m2m_foo="whatever")
+ def test_update_reverse_m2m_descriptor(self):
+ msg = (
+ "Cannot update model field <ManyToManyRel: update.bar> "
+ "(only non-relations and foreign keys permitted)."
+ )
+ with self.assertRaisesMessage(FieldError, msg):
+ Foo.objects.update(m2m_foo="whatever")
+
def test_update_transformed_field(self):
A.objects.create(x=5)
A.objects.create(x=-6)