MCPcopy
hub / github.com/scrapy/scrapy / test_custom_encoding_bytes

Method test_custom_encoding_bytes

tests/test_http_request_form.py:86–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

84 assert r2.headers[b"Content-Type"] == b"application/x-www-form-urlencoded"
85
86 def test_custom_encoding_bytes(self):
87 data = {b"\xb5 one": b"two", b"price": b"\xa3 100"}
88 r2 = self.request_class(
89 "http://www.example.com", formdata=data, encoding="latin1"
90 )
91 assert r2.method == "POST"
92 assert r2.encoding == "latin1"
93 self.assertQueryEqual(r2.body, b"price=%A3+100&%B5+one=two")
94 assert r2.headers[b"Content-Type"] == b"application/x-www-form-urlencoded"
95
96 def test_custom_encoding_textual_data(self):
97 data = {"price": "£ 100"}

Callers

nothing calls this directly

Calls 1

assertQueryEqualMethod · 0.95

Tested by

no test coverage detected