Fixed #21572 -- Added unit test for django.utils.text.normalize_newlines.
This commit is contained in:
parent
19b22d4f0e
commit
a1a26690b9
|
@ -107,6 +107,13 @@ class TestUtilsText(SimpleTestCase):
|
||||||
self.assertEqual(text.wrap('a %s word' % long_word, 10),
|
self.assertEqual(text.wrap('a %s word' % long_word, 10),
|
||||||
'a\n%s\nword' % long_word)
|
'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):
|
def test_slugify(self):
|
||||||
items = (
|
items = (
|
||||||
('Hello, World!', 'hello-world'),
|
('Hello, World!', 'hello-world'),
|
||||||
|
|
Loading…
Reference in New Issue