From 6f8b2d1c6dfaab4b18a2b10bca4e54bdbabc10d8 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Tue, 3 Feb 2026 10:14:31 +0000 Subject: 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. --- tests/model_inheritance/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/model_inheritance') 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") -- cgit v1.3