diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index 6758ee58edf..2f0e9ede6e3 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -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'),