mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #33618 -- Fixed MTI updates outside of primary key chain.
This commit is contained in:
committed by
Mariusz Felisiak
parent
9ffd4eae2c
commit
0b31e02487
@@ -667,3 +667,15 @@ class ModelInheritanceTest(TestCase):
|
||||
Politician.objects.get(pk=c1.politician_ptr_id).title,
|
||||
"senator 1",
|
||||
)
|
||||
|
||||
def test_mti_update_parent_through_child(self):
|
||||
Politician.objects.create()
|
||||
Congressman.objects.create()
|
||||
Congressman.objects.update(title="senator 1")
|
||||
self.assertEqual(Congressman.objects.get().title, "senator 1")
|
||||
|
||||
def test_mti_update_grand_parent_through_child(self):
|
||||
Politician.objects.create()
|
||||
Senator.objects.create()
|
||||
Senator.objects.update(title="senator 1")
|
||||
self.assertEqual(Senator.objects.get().title, "senator 1")
|
||||
|
||||
Reference in New Issue
Block a user