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

Made warning assertions work with or without -Wall python switch

This commit is contained in:
Claude Paroz
2012-05-03 20:18:05 +02:00
parent 10cf3c6427
commit 00c0d3c44e
5 changed files with 7 additions and 6 deletions

View File

@@ -79,7 +79,7 @@ class TestUtilsText(SimpleTestCase):
text.truncate_words('The quick brown fox jumped over the lazy dog.', 4))
self.assertEqual(u'The quick brown fox ....',
text.truncate_words('The quick brown fox jumped over the lazy dog.', 4, '....'))
self.assertEqual(len(w), 3)
self.assertGreater(len(w), 0)
def test_old_truncate_html_words(self):
with warnings.catch_warnings(record=True) as w:
@@ -91,7 +91,7 @@ class TestUtilsText(SimpleTestCase):
text.truncate_html_words('<p><strong><em>The quick brown fox jumped over the lazy dog.</em></strong></p>', 4, '....'))
self.assertEqual(u'<p><strong><em>The quick brown fox</em></strong></p>',
text.truncate_html_words('<p><strong><em>The quick brown fox jumped over the lazy dog.</em></strong></p>', 4, None))
self.assertEqual(len(w), 4)
self.assertGreater(len(w), 0)
def test_wrap(self):
digits = '1234 67 9'