mirror of
https://github.com/django/django.git
synced 2025-09-10 11:09:12 +00:00
Refs #36481 -- Improved test coverage for invalid updates on reverse relations.
This commit is contained in:
parent
34bd3ed944
commit
11c2c9ac17
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user