def test_get_text(self): html = u""" <div> <p>Here is my HTML.</p> <p>It has my text in it.</p> </div> """ text = get_text(html) self.assertEqual(text, u""" Here is my HTML. It has my text in it. """)
def test_sanitized_get_text(self): sanitized_html = sanitize(TEST_DOCUMENT) text = get_text(sanitized_html) self.assertEqual(text, u"Header\n\nText")