From 1572a3d4b2dd4afd004765ba73a2c38b311b65ee Mon Sep 17 00:00:00 2001
From: Julien Phalip
Date: Mon, 2 Jan 2012 18:47:18 +0000
Subject: Fixed #10931 -- Made `Truncator` handle newlines properly. Thanks to
gsong and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
---
tests/regressiontests/utils/text.py | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'tests/regressiontests/utils')
diff --git a/tests/regressiontests/utils/text.py b/tests/regressiontests/utils/text.py
index d4aa53fba9..aae75339bc 100644
--- a/tests/regressiontests/utils/text.py
+++ b/tests/regressiontests/utils/text.py
@@ -62,6 +62,11 @@ class TestUtilsText(unittest.TestCase):
'
', truncator.words(4, '....', html=True))
self.assertEqual(u'The quick brown fox'
'
', truncator.words(4, '', html=True))
+ # Test with new line inside tag
+ truncator = text.Truncator('The quick brown fox jumped over the lazy dog.
')
+ self.assertEqual(u'The quick brown...
', truncator.words(3, '...', html=True))
def test_old_truncate_words(self):
self.assertEqual(u'The quick brown fox jumped over the lazy dog.',
--
cgit v1.3