mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +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:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user