本文整理汇总了Python中pixelated.adapter.model.mail.PixelatedMail._decode_header方法的典型用法代码示例。如果您正苦于以下问题:Python PixelatedMail._decode_header方法的具体用法?Python PixelatedMail._decode_header怎么用?Python PixelatedMail._decode_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pixelated.adapter.model.mail.PixelatedMail
的用法示例。
在下文中一共展示了PixelatedMail._decode_header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_encoding_special_character_on_header
# 需要导入模块: from pixelated.adapter.model.mail import PixelatedMail [as 别名]
# 或者: from pixelated.adapter.model.mail.PixelatedMail import _decode_header [as 别名]
def test_encoding_special_character_on_header(self):
subject = "=?UTF-8?Q?test_encoding_St=C3=A4ch?="
email_from = "=?UTF-8?Q?St=C3=A4ch_<[email protected]>?="
email_to = "=?utf-8?b?IsOEw7zDtiDDlsO8w6QiIDxmb2xrZXJAcGl4ZWxhdGVkLXByb2plY3Qub3Jn?=\n =?utf-8?b?PiwgRsO2bGtlciA8Zm9sa2VyQHBpeGVsYXRlZC1wcm9qZWN0Lm9yZz4=?="
pixel_mail = PixelatedMail()
self.assertEqual(pixel_mail._decode_header(subject), 'test encoding St\xc3\xa4ch')
self.assertEqual(pixel_mail._decode_header(email_from), 'St\xc3\xa4ch <[email protected]>')
self.assertEqual(pixel_mail._decode_header(email_to), '"\xc3\x84\xc3\xbc\xc3\xb6 \xc3\x96\xc3\xbc\xc3\xa4" <[email protected]>, F\xc3\xb6lker <[email protected]>')
self.assertEqual(pixel_mail._decode_header(None), None)