Fixed #23352 -- Added tests for MigrationGraph.{forwards,backwards}_plan

This commit is contained in:
Raffaele Salmaso 2014-08-23 11:37:25 +02:00 committed by Tim Graham
parent 1f45f3cea1
commit be4baaefe2
1 changed files with 13 additions and 0 deletions

View File

@ -133,3 +133,16 @@ class GraphTests(TestCase):
CircularDependencyError,
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"))