mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user