def test_unicode(self): text = u'Hellø world' self.assertEqual( c2h.highlight_text(u'lø', text), u'Hel<mark>lø</mark> world', )
def test_markup(self): text = 'Hello & goodbye' self.assertEqual( c2h.highlight_text('lo & goo', text), 'Hel<mark>lo & goo</mark>dbye', )
def test_link(self): text = '<a href="https://example.com/">https://example.com/' self.assertEqual( c2h.highlight_text('example', text), '<a href="https://example.com/">https://<mark>example</mark>.com/', )
def test(self): text = 'Hello world' self.assertEqual( c2h.highlight_text('lo', text), 'Hel<mark>lo</mark> world', )
def test_case_insensitive(self): text = 'HelLo world' self.assertEqual( c2h.highlight_text('lo', text), 'Hel<mark>Lo</mark> world', )