diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-09-05 15:37:16 -0700 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-09-05 15:37:16 -0700 |
| commit | 2145a7782a2a0a4902b3cc4bc769010d4e2c337a (patch) | |
| tree | d11deeaef96c010b50cbf7edc20a2fb59c4bba77 /tests | |
| parent | 45768e6b72607b4bc913358c560830454f3336a7 (diff) | |
| parent | b878c73fc34e661e1cc30fc96171ce09918efced (diff) | |
Merge pull request #3171 from ClipCard/master
Prevent possible recursion limit issue in migration planning
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_graph.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/migrations/test_graph.py b/tests/migrations/test_graph.py index ada8a5a1e5..23ec450246 100644 --- a/tests/migrations/test_graph.py +++ b/tests/migrations/test_graph.py @@ -134,6 +134,21 @@ class GraphTests(TestCase): graph.forwards_plan, ("app_a", "0003"), ) + def test_dfs(self): + graph = MigrationGraph() + root = ("app_a", "1") + graph.add_node(root, None) + expected = [root] + for i in xrange(2, 1000): + parent = ("app_a", str(i - 1)) + child = ("app_a", str(i)) + graph.add_node(child, None) + graph.add_dependency(str(i), child, parent) + expected.append(child) + + actual = graph.dfs(root, lambda x: graph.dependents.get(x, set())) + self.assertEqual(expected[::-1], actual) + def test_plan_invalid_node(self): """ Tests for forwards/backwards_plan of nonexistent node. |
