MCPcopy
hub / github.com/django/django / test_non_ascii_POST

Method test_non_ascii_POST

tests/requests_tests/tests.py:382–392  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

380 self.assertEqual(request.POST, {})
381
382 def test_non_ascii_POST(self):
383 payload = FakePayload(urlencode({"key": "España"}))
384 request = WSGIRequest(
385 {
386 "REQUEST_METHOD": "POST",
387 "CONTENT_LENGTH": len(payload),
388 "CONTENT_TYPE": "application/x-www-form-urlencoded",
389 "wsgi.input": payload,
390 }
391 )
392 self.assertEqual(request.POST, {"key": ["España"]})
393
394 def test_non_utf8_charset_POST_bad_request(self):
395 payload = FakePayload(urlencode({"key": "España".encode("latin-1")}))

Callers

nothing calls this directly

Calls 3

FakePayloadClass · 0.90
WSGIRequestClass · 0.90
urlencodeFunction · 0.50

Tested by

no test coverage detected