示例#1
0
    def test_unicode_passthrough(self):
        already_unicode = u"€"

        # if this doesn't passthrough, it will error
        email_utils._unicode_damnit(already_unicode, "ascii", "strict")
示例#2
0
 def test_invalid_charset(self):
     text = "Växjö"
     self.assertEqual(email_utils._unicode_damnit(text, "utf-8"), u"Växjö")
     self.assertEqual(email_utils._unicode_damnit(text, "unicode"), u"V\ufffd\ufffdxj\ufffd\ufffd")
示例#3
0
 def test_is_unicode(self):
     string = "Hey there!"
     self.assertTrue(isinstance(email_utils._unicode_damnit(string), unicode))