'Tests for missing nodes, using `validate_consistency()` to raise the error.'

def test_validate_consistency(self):

    graph = MigrationGraph()
    graph.add_node(('app_a', '0001'), None)
    graph.add_dependency('app_a.0001', ('app_a', '0001'), ('app_b', '0002'), skip_validation=True)
    msg = "Migration    app_a.0001    dependencies    reference    nonexistent    parent    node    ('app_b',    '0002')"
    with self.assertRaisesMessage(NodeNotFoundError, msg):
        graph.validate_consistency()
    graph.add_node(('app_b', '0002'), None)
    graph.validate_consistency()
    graph.add_dependency('app_a.0002', ('app_a', '0002'), ('app_a', '0001'), skip_validation=True)
    msg = "Migration    app_a.0002    dependencies    reference    nonexistent    child    node    ('app_a',    '0002')"
    with self.assertRaisesMessage(NodeNotFoundError, msg):
        graph.validate_consistency()
    graph.add_node(('app_a', '0002'), None)
    graph.validate_consistency()
    msg = "app_a.0001    (req'd    by    app_a.0002)    is    missing!"
    graph.add_dummy_node(key=('app_a', '0001'), origin='app_a.0002', error_message=msg)
    with self.assertRaisesMessage(NodeNotFoundError, msg):
        graph.validate_consistency()
