mirror of https://github.com/django/django.git
Merge pull request #2045 from vajrasky/ticket_21572
Fixed #21572 -- Added unit test for django.utils.text.normalize_newlines...
This commit is contained in:
commit
6d20a80d98
|
@ -107,6 +107,13 @@ class TestUtilsText(SimpleTestCase):
|
|||
self.assertEqual(text.wrap('a %s word' % long_word, 10),
|
||||
'a\n%s\nword' % long_word)
|
||||
|
||||
def test_normalize_newlines(self):
|
||||
self.assertEqual(text.normalize_newlines("abc\ndef\rghi\r\n"),
|
||||
"abc\ndef\nghi\n")
|
||||
self.assertEqual(text.normalize_newlines("\n\r\r\n\r"), "\n\n\n\n")
|
||||
self.assertEqual(text.normalize_newlines("abcdefghi"), "abcdefghi")
|
||||
self.assertEqual(text.normalize_newlines(""), "")
|
||||
|
||||
def test_slugify(self):
|
||||
items = (
|
||||
('Hello, World!', 'hello-world'),
|
||||
|
|
Loading…
Reference in New Issue