MCPcopy
hub / github.com/django/django / test_missing_parent_nodes

Method test_missing_parent_nodes

tests/migrations/test_graph.py:231–248  ·  view source on GitHub ↗

Tests for missing parent nodes.

(self)

Source from the content-addressed store, hash-verified

229 graph.backwards_plan(("app_b", "0001"))
230
231 def test_missing_parent_nodes(self):
232 """
233 Tests for missing parent nodes.
234 """
235 # Build graph
236 graph = MigrationGraph()
237 graph.add_node(("app_a", "0001"), None)
238 graph.add_node(("app_a", "0002"), None)
239 graph.add_node(("app_a", "0003"), None)
240 graph.add_node(("app_b", "0001"), None)
241 graph.add_dependency("app_a.0003", ("app_a", "0003"), ("app_a", "0002"))
242 graph.add_dependency("app_a.0002", ("app_a", "0002"), ("app_a", "0001"))
243 msg = (
244 "Migration app_a.0001 dependencies reference nonexistent parent node "
245 "('app_b', '0002')"
246 )
247 with self.assertRaisesMessage(NodeNotFoundError, msg):
248 graph.add_dependency("app_a.0001", ("app_a", "0001"), ("app_b", "0002"))
249
250 def test_missing_child_nodes(self):
251 """

Callers

nothing calls this directly

Calls 4

add_nodeMethod · 0.95
add_dependencyMethod · 0.95
MigrationGraphClass · 0.90
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected