MCPcopy
hub / github.com/django/django / test_utf8_charset_POST

Method test_utf8_charset_POST

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

Source from the content-addressed store, hash-verified

411 request.FILES
412
413 def test_utf8_charset_POST(self):
414 for charset in ["utf-8", "UTF-8"]:
415 with self.subTest(charset=charset):
416 payload = FakePayload(urlencode({"key": "España"}))
417 request = WSGIRequest(
418 {
419 "REQUEST_METHOD": "POST",
420 "CONTENT_LENGTH": len(payload),
421 "CONTENT_TYPE": (
422 f"application/x-www-form-urlencoded; charset={charset}"
423 ),
424 "wsgi.input": payload,
425 }
426 )
427 self.assertEqual(request.POST, {"key": ["España"]})
428
429 def test_body_after_POST_multipart_form_data(self):
430 """

Callers

nothing calls this directly

Calls 3

FakePayloadClass · 0.90
WSGIRequestClass · 0.90
urlencodeFunction · 0.50

Tested by

no test coverage detected