  
          with self.assertRaisesMessage(ValueError, message):
              graph.forwards_plan(("app_b", "0001"))
  
          with self.assertRaisesMessage(ValueError, message):
              graph.backwards_plan(("app_b", "0001"))
  
      def test_missing_parent_nodes(self):
          """
          Tests for missing parent nodes.
 
</s> remove         with self.assertRaisesMessage(ValueError, message):
 </s> add         with self.assertRaisesMessage(NodeNotFoundError, message): </s> remove         with self.assertRaisesMessage(KeyError, msg):
 </s> add         with self.assertRaisesMessage(NodeNotFoundError, msg): </s> remove         with self.assertRaisesMessage(KeyError, msg):
 </s> add         with self.assertRaisesMessage(NodeNotFoundError, msg): </s> remove from django.db.migrations.graph import MigrationGraph, CircularDependencyError
 </s> add from django.db.migrations.graph import CircularDependencyError, MigrationGraph, NodeNotFoundError </s> remove                     self.graph.add_dependency(migration, child, key)
 </s> add                     try:
                        self.graph.add_dependency(migration, child, key)
                    except NodeNotFoundError as e:
                        # Since we added "key" to the nodes before this implies
                        # "child" is not in there.
                        _reraise_missing_dependency(migration, child, e)
        with self.assertRaisesMessage(NodeNotFoundError, message):
  
          with self.assertRaisesMessage(ValueError, message):
              graph.forwards_plan(("app_b", "0001"))
  
        with self.assertRaisesMessage(NodeNotFoundError, message):
              graph.backwards_plan(("app_b", "0001"))
  
      def test_missing_parent_nodes(self):
          """
          Tests for missing parent nodes.
keep keep keep keep replace keep keep keep keep keep
 Fixed #23556 -- Raised a more meaningful error message when migrations refer to an unavailable node 
tests/migrations/test_graph.py