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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user