Opened 11 years ago
Closed 11 years ago
#21505 closed Cleanup/optimization (fixed)
Add unit test for django.utils.text.get_valid_filename
Reported by: | Vajrasky Kok | Owned by: | Vajrasky Kok |
---|---|---|---|
Component: | Utilities | Version: | dev |
Severity: | Normal | Keywords: | test |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
There is no unit test for django.utils.text.get_valid_filename.
get_valid_filename("john's portrait in 2004.jpg")
'johns_portrait_in_2004.jpg'
It is used by FileSystemStorage.
obj = Storage()
obj.normal.save("&'@{}[],$=!-#()%+~_.txt", ContentFile("more content"))
obj.normal.close()
print(obj.normal.name) ==> "-_.txt"
Change History (3)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Has patch: | set |
---|
comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Here is the PR: https://github.com/django/django/pull/1982