Kaydet (Commit) a1a26690 authored tarafından Vajrasky Kok's avatar Vajrasky Kok

Fixed #21572 -- Added unit test for django.utils.text.normalize_newlines.

üst 19b22d4f
......@@ -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'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment