Fixed #36093 -- Adjusted unique checks to account for inherited primary keys.

Regression in bf7b17d16d refs #36075.

Thanks Sage Abdullah for the report and tests.
This commit is contained in:
Simon Charette 2025-01-13 13:53:57 -05:00 committed by Sarah Boyce
parent e580926d74
commit 4bfec242b4
2 changed files with 6 additions and 1 deletions

View file

@ -343,6 +343,11 @@ class ModelInheritanceTests(TestCase):
self.assertEqual(type(MethodOverride.foo), DeferredAttribute)
def test_full_clean(self):
restaurant = Restaurant.objects.create()
with self.assertNumQueries(0), self.assertRaises(ValidationError):
restaurant.full_clean()
class ModelInheritanceDataTests(TestCase):
@classmethod