Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

TST fix tests to account for changes in w3lib 1.19

Mikhail Korobovba15b63ed696
diff --git a/tests/test_http_response.py b/tests/test_http_response.py
index a36ec3af6..b228344b5 100644
--- a/tests/test_http_response.py
+++ b/tests/test_http_response.py
@@ -272,7 +272,10 @@ class TextResponseTest(BaseResponseTest):
headers={"Content-type": ["text/html; charset=utf-8"]},
body=b"\xef\xbb\xbfWORD\xe3\xab")
self.assertEqual(r6.encoding, 'utf-8')
- self.assertEqual(r6.text, u'WORD\ufffd\ufffd')
+ self.assertIn(r6.text, {
+ u'WORD\ufffd\ufffd', # w3lib < 1.19.0
+ u'WORD\ufffd', # w3lib >= 1.19.0
+ })
def test_bom_is_removed_from_body(self):
# Inferring encoding from body also cache decoded body as sideeffect,