From 31501fb53e0987d0e3ddb1eaddd4ccee1feae407 Mon Sep 17 00:00:00 2001 From: Bouke Haarsma Date: Fri, 13 May 2016 18:42:54 -0400 Subject: [PATCH] Refs #18599 -- Added a test for assigning a GenericForeignKey in Model.__init__(). The issue was fixed by 8a47ba679d2da0dee74671a53ba0cd918b433e34 (refs #16508). --- tests/generic_relations/tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py index c22a6ef7e0..ca029c6050 100644 --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -572,6 +572,11 @@ id="id_generic_relations-taggeditem-content_type-object_id-1-id" />

""" % tag tag.object_id = cauliflower.id self.assertEqual(tag.content_object, cauliflower) + def test_assign_content_object_in_init(self): + spinach = Vegetable(name="spinach") + tag = TaggedItem(content_object=spinach) + self.assertEqual(tag.content_object, spinach) + class CustomWidget(forms.TextInput): pass