Refs #18599 -- Added a test for assigning a GenericForeignKey in Model.__init__().
The issue was fixed by 8a47ba679d
(refs #16508).
This commit is contained in:
parent
094ea69e07
commit
31501fb53e
|
@ -572,6 +572,11 @@ id="id_generic_relations-taggeditem-content_type-object_id-1-id" /></p>""" % tag
|
||||||
tag.object_id = cauliflower.id
|
tag.object_id = cauliflower.id
|
||||||
self.assertEqual(tag.content_object, cauliflower)
|
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):
|
class CustomWidget(forms.TextInput):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue