Improved comment

This commit is contained in:
Pablo Hoffman 2010-03-31 18:26:35 -03:00
parent 83d5eff0b7
commit 4dc886e319
1 changed files with 3 additions and 1 deletions

View File

@ -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())