Пример #1
0
    def test_html_unescape(self):

        # implicit concatenation
        statement = Statement(
            text=('The quick brown fox <b>jumps</b> over'
                  ' the <a href="http://lazy.com">lazy</a> dog.'))

        normal_text = ('The quick brown fox <b>jumps</b> over'
                       ' the <a href="http://lazy.com">lazy</a> dog.')

        cleaned = preprocessors.unescape_html(statement)

        self.assertEqual(cleaned.text, normal_text)
Пример #2
0
    def test_html_unescape(self):

        # implicit concatenation
        statement = Statement(
            text=(
                'The quick brown fox &lt;b&gt;jumps&lt;/b&gt; over'
                ' the <a href="http://lazy.com">lazy</a> dog.'
            )
        )

        normal_text = (
            'The quick brown fox <b>jumps</b> over'
            ' the <a href="http://lazy.com">lazy</a> dog.'
        )

        cleaned = preprocessors.unescape_html(statement)

        self.assertEqual(cleaned.text, normal_text)