Beispiel #1
0
 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&hellip;</b>', result)
Beispiel #2
0
 def truncate_text(self, *args, **kwargs):
     return utils.truncate_text(*args, **kwargs)
Beispiel #3
0
 def test_truncate_text(self):
     self.assertEqual(
         len(utils.truncate_text('foo bar foo bar', 2).split(' ')), 2)