mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #23953 -- Added MigrationAutodetector.parse_number() tests.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							514c16e85f
						
					
				
				
					commit
					6e4ac28af0
				
			| @@ -2664,6 +2664,20 @@ class AutodetectorTests(TestCase): | ||||
|         self.assertOperationAttributes(changes, 'app', 0, 0, name='title', model_name='readable') | ||||
|         self.assertOperationAttributes(changes, 'app', 0, 1, name='book') | ||||
|  | ||||
|     def test_parse_number(self): | ||||
|         tests = [ | ||||
|             ('no_number', None), | ||||
|             ('0001_initial', 1), | ||||
|             ('0002_model3', 2), | ||||
|             ('0002_auto_20380101_1112', 2), | ||||
|         ] | ||||
|         for migration_name, expected_number in tests: | ||||
|             with self.subTest(migration_name=migration_name): | ||||
|                 self.assertEqual( | ||||
|                     MigrationAutodetector.parse_number(migration_name), | ||||
|                     expected_number, | ||||
|                 ) | ||||
|  | ||||
|  | ||||
| class MigrationSuggestNameTests(SimpleTestCase): | ||||
|     def test_no_operations(self): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user