def test_to_str_with_latin_unicode(): wee = u'áéíóção@#'.decode('latin') got = multipart.to_str(wee) assert_equals(got, '\xc3\x83\xc2\xa1\xc3\x83\xc2\xa9\xc3\x83\xc2\xad\xc3' \ '\x83\xc2\xb3\xc3\x83\xc2\xa7\xc3\x83\xc2\xa3o@#')
def test_to_str_with_nonstring(): got = multipart.to_str(5) assert_equals(got, u'5')