summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/requests/tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/requests/tests.py b/tests/requests/tests.py
index 0942619715..27dc439e5f 100644
--- a/tests/requests/tests.py
+++ b/tests/requests/tests.py
@@ -533,6 +533,25 @@ class RequestsTests(SimpleTestCase):
self.assertEqual(request.read(13), b'--boundary\r\nC')
self.assertEqual(request.POST, {'name': ['value']})
+ def test_POST_immutable_for_mutipart(self):
+ """
+ MultiPartParser.parse() leaves request.POST immutable.
+ """
+ payload = FakePayload("\r\n".join([
+ '--boundary',
+ 'Content-Disposition: form-data; name="name"',
+ '',
+ 'value',
+ '--boundary--',
+ ]))
+ request = WSGIRequest({
+ 'REQUEST_METHOD': 'POST',
+ 'CONTENT_TYPE': 'multipart/form-data; boundary=boundary',
+ 'CONTENT_LENGTH': len(payload),
+ 'wsgi.input': payload,
+ })
+ self.assertFalse(request.POST._mutable)
+
def test_POST_connection_error(self):
"""
If wsgi.input.read() raises an exception while trying to read() the