summaryrefslogtreecommitdiff
path: root/tests/model_inheritance
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2026-02-03 10:14:31 +0000
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-05 09:18:55 -0500
commit6f8b2d1c6dfaab4b18a2b10bca4e54bdbabc10d8 (patch)
treeb93bbfa765d1887560bf41d3137a330c9d8dab97 /tests/model_inheritance
parent13299a6203f4bc3e5b2552c96a51ff2b15da3c43 (diff)
Refs #33579 -- Added extra tests for NotUpdated exception.
When `NotUpdated` was added in ab148c02cedbac492f29930dcd5346e1af052635, these additional tests that have equivalents for the `DoesNotExist` and `MultipleObjectsReturned` exceptions were missed.
Diffstat (limited to 'tests/model_inheritance')
-rw-r--r--tests/model_inheritance/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/model_inheritance/tests.py b/tests/model_inheritance/tests.py
index 2b911d4dc5..4b8db72e5d 100644
--- a/tests/model_inheritance/tests.py
+++ b/tests/model_inheritance/tests.py
@@ -449,6 +449,12 @@ class ModelInheritanceDataTests(TestCase):
with self.assertRaises(Place.MultipleObjectsReturned):
Restaurant.objects.get()
+ def test_inherited_not_updated_exception(self):
+ # NotUpdated is also inherited.
+ obj = Restaurant(id=999)
+ with self.assertRaises(Place.NotUpdated):
+ obj.save(update_fields={"name"})
+
def test_related_objects_for_inherited_models(self):
# Related objects work just as they normally do.
s1 = Supplier.objects.create(name="Joe's Chickens", address="123 Sesame St")