Fixed #21505 -- Added unit test for django.utils.text.get_valid_filename.

This commit is contained in:
Vajrasky Kok 2013-11-24 16:10:21 +08:00 committed by Baptiste Mispelon
parent 101da92ebd
commit 7169722d5c
1 changed files with 4 additions and 0 deletions

View File

@ -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")