mirror of
https://github.com/django/django.git
synced 2025-07-22 10:39:13 +00:00
Refs #33865 -- Made RequestsTests.test_set_encoding_clears_GET use FakePayload.
The input stream, wsgi.input, must be a file-like object. The existing implementation of LimitedStream was lax and allowed an empty string to be passed incorrectly. See https://wsgi.readthedocs.io/en/latest/definitions.html#envvar-wsgi.input
This commit is contained in:
parent
63d1cb0092
commit
7a1543d9f6
@ -640,10 +640,11 @@ class RequestsTests(SimpleTestCase):
|
|||||||
self.assertEqual(request.POST, {"name": ["Hello GĂŒnter"]})
|
self.assertEqual(request.POST, {"name": ["Hello GĂŒnter"]})
|
||||||
|
|
||||||
def test_set_encoding_clears_GET(self):
|
def test_set_encoding_clears_GET(self):
|
||||||
|
payload = FakePayload("")
|
||||||
request = WSGIRequest(
|
request = WSGIRequest(
|
||||||
{
|
{
|
||||||
"REQUEST_METHOD": "GET",
|
"REQUEST_METHOD": "GET",
|
||||||
"wsgi.input": "",
|
"wsgi.input": payload,
|
||||||
"QUERY_STRING": "name=Hello%20G%C3%BCnter",
|
"QUERY_STRING": "name=Hello%20G%C3%BCnter",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user