Refs #9982 -- Added test for saving OneToOneField field after saving related object.

Fixed in 519016e5f2.
This commit is contained in:
Mariusz Felisiak 2019-05-24 10:54:05 +02:00 committed by GitHub
parent 45edd746cc
commit 85195dd237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -280,6 +280,14 @@ class OneToOneTests(TestCase):
self.assertEqual(num_deleted, 1)
self.assertEqual(objs, {'one_to_one.Pointer': 1})
def test_save_nullable_o2o_after_parent(self):
place = Place(name='Rose tattoo')
bar = UndergroundBar(place=place)
place.save()
bar.save()
bar.refresh_from_db()
self.assertEqual(bar.place, place)
def test_reverse_object_does_not_exist_cache(self):
"""
Regression for #13839 and #17439.