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