Skip to content

Commit

Permalink
Merge pull request #3092 from scrapy/fix-tests-for-w3lib-1.19
Browse files Browse the repository at this point in the history
Fix tests to account for changes in w3lib 1.19
  • Loading branch information
dangra committed Jan 26, 2018
2 parents 1d15812 + ba15b63 commit 8be28fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_http_response.py
Expand Up @@ -272,7 +272,10 @@ def test_invalid_utf8_encoded_body_with_valid_utf8_BOM(self):
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,
Expand Down

0 comments on commit 8be28fe

Please sign in to comment.