Fixed #28210 -- Fixed Model._state.adding on MTI parent model after saving child model.

Regression in 38575b007a.
This commit is contained in:
Tim Graham 2017-05-19 12:47:10 -04:00
parent 99df304c85
commit 59ab1b2683
3 changed files with 7 additions and 1 deletions

View file

@ -478,8 +478,9 @@ class ModelInheritanceTest(TestCase):
# The mismatch between Restaurant and Place is intentional (#28175).
self.assertSequenceEqual(Supplier.objects.filter(restaurant__in=Place.objects.all()), [s])
def test_ptr_accessor_assigns_db(self):
def test_ptr_accessor_assigns_state(self):
r = Restaurant.objects.create()
self.assertIs(r.place_ptr._state.adding, False)
self.assertEqual(r.place_ptr._state.db, 'default')
def test_related_filtering_query_efficiency_ticket_15844(self):