From 7169722d5c4c9f9829e353fbeda08b7550bf8991 Mon Sep 17 00:00:00 2001 From: Vajrasky Kok Date: Sun, 24 Nov 2013 16:10:21 +0800 Subject: [PATCH] Fixed #21505 -- Added unit test for django.utils.text.get_valid_filename. --- tests/utils_tests/test_text.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index 62e792fab6..6758ee58ed 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -127,3 +127,7 @@ class TestUtilsText(SimpleTestCase): ] for value, output in items: self.assertEqual(text.unescape_entities(value), output) + + def test_get_valid_filename(self): + filename = "^&'@{}[],$=!-#()%+~_123.txt" + self.assertEqual(text.get_valid_filename(filename), "-_123.txt")