mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
[1.11.x] Fixed #28166 -- Fixed Model._state.db on MTI parent model after saving child model.
Regression in38575b007a. Backport of584e10c76efrom master
This commit is contained in:
@@ -474,6 +474,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",
|
||||
|
||||
Reference in New Issue
Block a user