diff options
| author | Simon Charette <charette.s@gmail.com> | 2022-04-05 22:03:20 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-04-07 07:54:56 +0200 |
| commit | 0b31e024873681e187b574fe1c4afe5e48aeeecf (patch) | |
| tree | 3e481b37455c08f8406001fa114c40de29032995 /tests/model_inheritance_regress | |
| parent | 9ffd4eae2ce7a7100c98f681e2b6ab818df384a4 (diff) | |
Fixed #33618 -- Fixed MTI updates outside of primary key chain.
Diffstat (limited to 'tests/model_inheritance_regress')
| -rw-r--r-- | tests/model_inheritance_regress/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py index 6c593d4521..936a555684 100644 --- a/tests/model_inheritance_regress/tests.py +++ b/tests/model_inheritance_regress/tests.py @@ -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") |
