def test_truncate_text_with_html(self): result = utils.truncate_text('foo <b>bar</b> <span>foo bar</span>', 2) self.assertEqual('foo <b>bar…</b>', result)
def truncate_text(self, *args, **kwargs): return utils.truncate_text(*args, **kwargs)
def test_truncate_text(self): self.assertEqual( len(utils.truncate_text('foo bar foo bar', 2).split(' ')), 2)