def test_getNodeUnicodeText(self):
        """
        L{domhelpers.getNodeText} returns a C{unicode} string when text
        nodes are represented in the DOM with unicode, whether or not there
        are non-ASCII characters present.
        """
        node = self.dom.parseString("<foo>bar</foo>")
        text = domhelpers.getNodeText(node)
        self.assertEqual(text, u"bar")
        self.assertIsInstance(text, unicode)

        node = self.dom.parseString(u"<foo>\N{SNOWMAN}</foo>".encode('utf-8'))
        text = domhelpers.getNodeText(node)
        self.assertEqual(text, u"\N{SNOWMAN}")
        self.assertIsInstance(text, unicode)

        L{domhelpers.getNodeText} returns a C{unicode} string when text
        nodes are represented in the DOM with unicode, whether or not there
        are non-ASCII characters present.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_domhelpers.py