def test_replaceNonChild(self):
        """
        L{Node.replaceChild} raises L{ValueError} if the node given to be
        replaced is not a child of the node C{replaceChild} is called on.
        """
        parent = microdom.parseString('<foo />')
        orphan = microdom.parseString('<bar />')
        replacement = microdom.parseString('<baz />')

        self.assertRaises(
            ValueError, parent.replaceChild, replacement, orphan)

        L{Node.replaceChild} raises L{ValueError} if the node given to be
        replaced is not a child of the node C{replaceChild} is called on.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_xml.py