summaryrefslogtreecommitdiff
path: root/tests/model_inheritance_regress
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-05-03 10:39:54 -0400
committerTim Graham <timograham@gmail.com>2017-05-03 12:14:15 -0400
commit584e10c76edcd3a33765a52c5cde0096a3ce7dbc (patch)
treee04cd32a2e06aa19875698177424574bfd5663f8 /tests/model_inheritance_regress
parent362fba87c9bb4f88542ba82ce4a732fed2634be7 (diff)
downloaddjango-584e10c76edcd3a33765a52c5cde0096a3ce7dbc.tar.gz
Fixed #28166 -- Fixed Model._state.db on MTI parent model after saving child model.
Regression in 38575b007a722d6af510ea46d46393a4cda9ca29.
Diffstat (limited to 'tests/model_inheritance_regress')
-rw-r--r--tests/model_inheritance_regress/tests.py4
1 files changed, 4 insertions, 0 deletions
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",