From 584e10c76edcd3a33765a52c5cde0096a3ce7dbc Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 3 May 2017 10:39:54 -0400 Subject: Fixed #28166 -- Fixed Model._state.db on MTI parent model after saving child model. Regression in 38575b007a722d6af510ea46d46393a4cda9ca29. --- tests/model_inheritance_regress/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py index 9cb710c4b8..87ec11a5b1 100644 --- a/tests/model_inheritance_regress/tests.py +++ b/tests/model_inheritance_regress/tests.py @@ -472,6 +472,10 @@ class ModelInheritanceTest(TestCase): jane = Supplier.objects.order_by("name").select_related("restaurant")[0] self.assertEqual(jane.restaurant.name, "Craft") + def test_ptr_accessor_assigns_db(self): + r = Restaurant.objects.create() + self.assertEqual(r.place_ptr._state.db, 'default') + def test_related_filtering_query_efficiency_ticket_15844(self): r = Restaurant.objects.create( name="Guido's House of Pasta", -- cgit v1.3