def test_decode_method(self): """ FomsDict.attribute returs u'' on UnicodeError. """ data = tob('äöü') d = FormsDict(py2=data, py3=data.decode('latin1')) d = d.decode() self.assertFalse(d.recode_unicode) self.assertTrue(hasattr(list(d.keys())[0], 'encode')) self.assertTrue(hasattr(list(d.values())[0], 'encode'))
def test_decode_method(self): """ FomsDict.attribute returs u'' on UnicodeError. """ data = tob('äöü') d = FormsDict(py2=data, py3=data.decode('latin1')) d = d.decode() self.assertFalse(d.recode_unicode) self.assertEqual(unicode, type(list(d.keys())[0])) self.assertEqual(unicode, type(list(d.values())[0]))
def test_decode_method(self): d = FormsDict(py2=tob('瓶'), py3=tob('瓶').decode('latin1')) d = d.decode() self.assertFalse(d.recode_unicode) self.assertTrue(hasattr(list(d.keys())[0], 'encode')) self.assertTrue(hasattr(list(d.values())[0], 'encode'))