Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 def test_shoulde_decode_bytes(self):
     data = b"xpto"
     self.assertEqual("xpto", force_text(data))
Exemplo n.º 3
0
 def test_should_decode_a_string(self):
     string = "Blá blá"
     self.assertEqual("Blá blá", force_text(string))
Exemplo n.º 4
0
 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))
Exemplo n.º 5
0
 def test_shoulde_decode_bytes(self):
     data = b"xpto"
     self.assertEqual("xpto", force_text(data))
Exemplo n.º 6
0
 def test_should_decode_a_string(self):
     string = "Blá blá"
     self.assertEqual("Blá blá", force_text(string))