def test_childRestriction(self):
        """
        L{Document.appendChild} raises L{ValueError} if the document already
        has a child.
        """
        document = microdom.Document()
        child = microdom.Node()
        another = microdom.Node()
        document.appendChild(child)
        self.assertRaises(ValueError, document.appendChild, another)

        L{Document.appendChild} raises L{ValueError} if the document already
        has a child.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_xml.py