'Test invalid chars are replaced properly'

def test_replace_wrong_encoding(self):

    r = self.response_class('http://www.example.com', encoding='utf-8', body='PREFIX\xe3\xabSUFFIX')
    assert (u'\ufffd' in r.text), repr(r.text)
    assert (u'PREFIX' in r.text), repr(r.text)
    assert (u'SUFFIX' in r.text), repr(r.text)
    r = self.response_class('http://example.com', encoding='utf-8', body='\xf0<span>value</span>')
    assert (u'<span>value</span>' in r.text), repr(r.text)
