def test_should_be_able_to_chose_the_encoding(self): ENCODING = "IBM857" data = b"xpto".decode("utf-8").encode(ENCODING) self.assertEqual("xpto", force_text(data, encoding=ENCODING))
def test_shoulde_decode_bytes(self): data = b"xpto" self.assertEqual("xpto", force_text(data))
def test_should_decode_a_string(self): string = "Blá blá" self.assertEqual("Blá blá", force_text(string))
def test_should_be_able_to_chose_the_encoding(self): ENCODING = 'IBM857' data = b"xpto".decode("utf-8").encode(ENCODING) self.assertEqual("xpto", force_text(data, encoding=ENCODING))