1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Inserted more simplefilter calls to be sure warnings are emitted.

Thanks to Florian Apolloner for suggesting the patch.
This commit is contained in:
Claude Paroz
2012-05-03 21:23:50 +02:00
parent 00c0d3c44e
commit 11a5355517
4 changed files with 5 additions and 0 deletions

View File

@@ -73,6 +73,7 @@ class TestUtilsText(SimpleTestCase):
def test_old_truncate_words(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
self.assertEqual(u'The quick brown fox jumped over the lazy dog.',
text.truncate_words(u'The quick brown fox jumped over the lazy dog.', 10))
self.assertEqual(u'The quick brown fox ...',
@@ -83,6 +84,7 @@ class TestUtilsText(SimpleTestCase):
def test_old_truncate_html_words(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
self.assertEqual(u'<p><strong><em>The quick brown fox jumped over the lazy dog.</em></strong></p>',
text.truncate_html_words('<p><strong><em>The quick brown fox jumped over the lazy dog.</em></strong></p>', 10))
self.assertEqual(u'<p><strong><em>The quick brown fox ...</em></strong></p>',