Use unichr() instead of chr() with Python 2.

This commit is contained in:
Andrea Corbellini 2015-09-22 20:52:30 +02:00
commit c255a35800
2 changed files with 14 additions and 2 deletions

View file

@ -190,6 +190,18 @@ class TestUtils(LoggedTestCase):
self.assertEqual(
utils.truncate_html_words("cafetiére " * 100, 20),
"cafetiére " * 20 + '...')
self.assertEqual(
utils.truncate_html_words("∫dx " * 100, 20),
"∫dx " * 20 + '...')
# Words with HTML character references inside and outside
# the ASCII range.
self.assertEqual(
utils.truncate_html_words("é " * 100, 20),
"é " * 20 + '...')
self.assertEqual(
utils.truncate_html_words("∫dx " * 100, 20),
"∫dx " * 20 + '...')
def test_process_translations(self):
# create a bunch of articles