From 4dc886e3192095ccdbd6ec11c81dc676757308f6 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Wed, 31 Mar 2010 18:26:35 -0300 Subject: [PATCH] Improved comment --- scrapy/tests/test_http_response.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrapy/tests/test_http_response.py b/scrapy/tests/test_http_response.py index 842fc3790..d17d5d272 100644 --- a/scrapy/tests/test_http_response.py +++ b/scrapy/tests/test_http_response.py @@ -215,9 +215,11 @@ class TextResponseTest(BaseResponseTest): def test_replace_wrong_encoding(self): """Test invalid chars are replaced properly""" - # XXX: Policy for replacing invalid chars may change without prior notice r = self.response_class("http://www.example.com", encoding='utf-8', body='PREFIX\xe3\xabSUFFIX') + # XXX: Policy for replacing invalid chars may suffer minor variations + # but it should always contain the unicode replacement char (u'\ufffd') assert u'\ufffd' in r.body_as_unicode(), repr(r.body_as_unicode()) + # FIXME: This test should pass once we stop using BeautifulSoup's UnicodeDammit in TextResponse #r = self.response_class("http://www.example.com", body='PREFIX\xe3\xabSUFFIX') #assert u'\ufffd' in r.body_as_unicode(), repr(r.body_as_unicode())