From f319e7abad145ddcb1017293b5cdb7e09a92ee85 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 29 Nov 2017 01:06:45 -0500 Subject: [1.11.x] Fixed #28856 -- Fixed a regression in caching of a GenericForeignKey pointing to a MTI model. Regression in b9f8635f58ad743995cad2081b3dc395e55761e5. Backport of d31424fec1a3de9d281535c0503644a9d7b93c63 from stable/2.0.x --- tests/generic_relations_regress/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/generic_relations_regress/tests.py b/tests/generic_relations_regress/tests.py index b2d5b08692..e6d350aa5b 100644 --- a/tests/generic_relations_regress/tests.py +++ b/tests/generic_relations_regress/tests.py @@ -48,6 +48,12 @@ class GenericRelationTests(TestCase): TextLink.objects.create(content_object=oddrel) oddrel.delete() + def test_coerce_object_id_remote_field_cache_persistence(self): + restaurant = Restaurant.objects.create() + CharLink.objects.create(content_object=restaurant) + charlink = CharLink.objects.latest('pk') + self.assertIs(charlink.content_object, charlink.content_object) + def test_q_object_or(self): """ SQL query parameters for generic relations are properly -- cgit v1.3