Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
4b745eef
Commit
4b745eef
authored
Feb 26, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test for more graceful 1.8 handling of malformed filename encodings
parent
b3956bc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tests/test_parsers.py
+3
-2
No files found.
tests/test_parsers.py
View file @
4b745eef
...
@@ -101,9 +101,10 @@ class TestFileUploadParser(TestCase):
...
@@ -101,9 +101,10 @@ class TestFileUploadParser(TestCase):
self
.
__replace_content_disposition
(
'inline; filename=fallback.txt; filename*=utf-8--ÀĥƦ.txt'
)
self
.
__replace_content_disposition
(
'inline; filename=fallback.txt; filename*=utf-8--ÀĥƦ.txt'
)
filename
=
parser
.
get_filename
(
self
.
stream
,
None
,
self
.
parser_context
)
filename
=
parser
.
get_filename
(
self
.
stream
,
None
,
self
.
parser_context
)
# Malformed. Either None or 'fallback.txt' will be acceptable.
# Malformed. Either None, 'ÀĥƦ.txt' or 'fallback.txt' will be acceptable.
# See also https://code.djangoproject.com/ticket/24209
# See also https://code.djangoproject.com/ticket/24209
self
.
assertIn
(
filename
,
(
'fallback.txt'
,
None
))
self
.
assertIn
(
filename
,
(
'fallback.txt'
,
'ÀĥƦ.txt'
,
None
))
def
__replace_content_disposition
(
self
,
disposition
):
def
__replace_content_disposition
(
self
,
disposition
):
self
.
parser_context
[
'request'
]
.
META
[
'HTTP_CONTENT_DISPOSITION'
]
=
disposition
self
.
parser_context
[
'request'
]
.
META
[
'HTTP_CONTENT_DISPOSITION'
]
=
disposition
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment