diff options
| author | Jaap Roes <jaap@eight.nl> | 2013-07-18 10:45:34 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-08 08:24:58 -0400 |
| commit | 40b95a24ae159b6600457a23d6c2779a18037b7b (patch) | |
| tree | b87eeb863c18b32f524ee437d2b364c982199d19 /tests/utils_tests/test_text.py | |
| parent | 58d555caf527d6f1bdfeab14527484e4cca68648 (diff) | |
Fixed #20568 -- truncatewords_html no longer splits words containing HTML entities.
Thanks yann0 at hotmail.com for the report.
Diffstat (limited to 'tests/utils_tests/test_text.py')
| -rw-r--r-- | tests/utils_tests/test_text.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index dd72d26e06..62f1333517 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -82,6 +82,15 @@ class TestUtilsText(SimpleTestCase): self.assertEqual('<br>The <hr/>quick <em>brown...</em>', truncator.words(3, '...', html=True )) + # Test html entities + truncator = text.Truncator('<i>Buenos días!' + ' ¿Cómo está?</i>') + self.assertEqual('<i>Buenos días! ¿Cómo...</i>', + truncator.words(3, '...', html=True)) + truncator = text.Truncator('<p>I <3 python, what about you?</p>') + self.assertEqual('<p>I <3 python...</p>', + truncator.words(3, '...', html=True)) + def test_wrap(self): digits = '1234 67 9' self.assertEqual(text.wrap(digits, 100), '1234 67 9') |
