mirror of https://github.com/scrapy/scrapy.git
fix-utf16-response-test-on-big-endian-systems (#7508)
This commit is contained in:
parent
361f689df7
commit
870803b7fb
|
|
@ -163,12 +163,13 @@ class TestTextResponse(TestResponse):
|
||||||
|
|
||||||
def test_utf16(self):
|
def test_utf16(self):
|
||||||
"""Test utf-16 because UnicodeDammit is known to have problems with"""
|
"""Test utf-16 because UnicodeDammit is known to have problems with"""
|
||||||
|
body = b"\xff\xfeh\x00i\x00"
|
||||||
r = self.response_class(
|
r = self.response_class(
|
||||||
"http://www.example.com",
|
"http://www.example.com",
|
||||||
body=b"\xff\xfeh\x00i\x00",
|
body=body,
|
||||||
encoding="utf-16",
|
encoding="utf-16",
|
||||||
)
|
)
|
||||||
self._assert_response_values(r, "utf-16", "hi")
|
self._assert_response_values(r, "utf-16", body)
|
||||||
|
|
||||||
def test_invalid_utf8_encoded_body_with_valid_utf8_BOM(self):
|
def test_invalid_utf8_encoded_body_with_valid_utf8_BOM(self):
|
||||||
r6 = self.response_class(
|
r6 = self.response_class(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue