mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.7.x] Fixed #23352 -- Added tests for MigrationGraph.{forwards,backwards}_plan
Backport of be4baaefe2 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							3d88ed3341
						
					
				
				
					commit
					4ae75cf051
				
			| @@ -133,3 +133,16 @@ class GraphTests(TestCase): | |||||||
|             CircularDependencyError, |             CircularDependencyError, | ||||||
|             graph.forwards_plan, ("app_a", "0003"), |             graph.forwards_plan, ("app_a", "0003"), | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  |     def test_plan_invalid_node(self): | ||||||
|  |         """ | ||||||
|  |         Tests for forwards/backwards_plan of nonexistent node. | ||||||
|  |         """ | ||||||
|  |         graph = MigrationGraph() | ||||||
|  |         message = "Node ('app_b', '0001') not a valid node" | ||||||
|  |  | ||||||
|  |         with self.assertRaisesMessage(ValueError, message): | ||||||
|  |             graph.forwards_plan(("app_b", "0001")) | ||||||
|  |  | ||||||
|  |         with self.assertRaisesMessage(ValueError, message): | ||||||
|  |             graph.backwards_plan(("app_b", "0001")) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user