mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Fixed #22679 -- Fixed empty tuple serialization in MigrationWriter.
Thanks rockallite.wulf for the report.
Backport of ad994a3c5b from master.
			
			
This commit is contained in:
		
				
					committed by
					
						 Baptiste Mispelon
						Baptiste Mispelon
					
				
			
			
				
	
			
			
			
						parent
						
							fb45e666c2
						
					
				
				
					commit
					7d4a51e239
				
			| @@ -125,6 +125,18 @@ class WriterTests(TestCase): | ||||
|             ) | ||||
|         ) | ||||
|  | ||||
|     def test_serialize_empty_nonempty_tuple(self): | ||||
|         """ | ||||
|         Ticket #22679: makemigrations generates invalid code for (an empty | ||||
|         tuple) default_permissions = () | ||||
|         """ | ||||
|         empty_tuple = () | ||||
|         one_item_tuple = ('a') | ||||
|         many_items_tuple = ('a', 'b', 'c') | ||||
|         self.assertSerializedEqual(empty_tuple) | ||||
|         self.assertSerializedEqual(one_item_tuple) | ||||
|         self.assertSerializedEqual(many_items_tuple) | ||||
|  | ||||
|     def test_simple_migration(self): | ||||
|         """ | ||||
|         Tests serializing a simple migration. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user