예제 #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))