diff options
| author | Raffaele Salmaso <raffaele@salmaso.org> | 2014-08-23 11:37:25 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-23 21:35:13 +0000 |
| commit | be4baaefe2e8e7effa3c510b31746dbb41ec422a (patch) | |
| tree | 361e663bbc051d930fd3c3d624fa9b2c0d6fe0f9 /tests/migrations/test_graph.py | |
| parent | 1f45f3cea1623d7b1414c48869535bd3350b4ba8 (diff) | |
Fixed #23352 -- Added tests for MigrationGraph.{forwards,backwards}_plan
Diffstat (limited to 'tests/migrations/test_graph.py')
| -rw-r--r-- | tests/migrations/test_graph.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/test_graph.py b/tests/migrations/test_graph.py index b6a7c62561..a72619eea5 100644 --- a/tests/migrations/test_graph.py +++ b/tests/migrations/test_graph.py @@ -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")) |
