MCPcopy
hub / github.com/django/django / test_utf16_payload

Method test_utf16_payload

tests/test_client_regress/tests.py:1268–1274  ·  view source on GitHub ↗

Non-ASCII data encoded as UTF-16 can be POSTed.

(self)

Source from the content-addressed store, hash-verified

1266 self.assertEqual(response.content, text.encode())
1267
1268 def test_utf16_payload(self):
1269 """Non-ASCII data encoded as UTF-16 can be POSTed."""
1270 text = "dog: собака"
1271 response = self.client.post(
1272 "/parse_encoded_text/", text, content_type="text/plain; charset=utf-16"
1273 )
1274 self.assertEqual(response.content, text.encode("utf-16"))
1275
1276 def test_non_utf_payload(self):
1277 """Non-ASCII data as a non-UTF based encoding can be POSTed."""

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected