mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Implement Migration.run_before
This attribute (used for reverse dependencies) was previously declared and mentioned in the code, but never actually used.
This commit is contained in:
		
				
					committed by
					
						 Andrew Godwin
						Andrew Godwin
					
				
			
			
				
	
			
			
			
						parent
						
							31fc34e447
						
					
				
				
					commit
					9f1c4e4d3f
				
			| @@ -102,6 +102,22 @@ class LoaderTests(TestCase): | ||||
|             ["id", "user"] | ||||
|         ) | ||||
|  | ||||
|     @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_run_before"}) | ||||
|     def test_run_before(self): | ||||
|         """ | ||||
|         Makes sure the loader uses Migration.run_before. | ||||
|         """ | ||||
|         # Load and test the plan | ||||
|         migration_loader = MigrationLoader(connection) | ||||
|         self.assertEqual( | ||||
|             migration_loader.graph.forwards_plan(("migrations", "0002_second")), | ||||
|             [ | ||||
|                 ("migrations", "0001_initial"), | ||||
|                 ("migrations", "0003_third"), | ||||
|                 ("migrations", "0002_second"), | ||||
|             ], | ||||
|         ) | ||||
|  | ||||
|     @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) | ||||
|     def test_name_match(self): | ||||
|         "Tests prefix name matching" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user