Beispiel #1
0
    def test_email_message_utf_8(self):
        message_obj = EmailMessage(u'件名', u'本文',
                                   u'差出人 <*****@*****.**>',
                                   [u'宛先 <*****@*****.**>'])
        message_obj.encoding = 'utf-8'
        message = message_obj.message()

        self.assertEqual(message['Subject'], '=?utf-8?b?5Lu25ZCN?=')
Beispiel #2
0
    def test_email_message_cp932_alias_sjis(self):
        message_obj = EmailMessage(
            u'件名',
            u'本文',
            u'差出人 <*****@*****.**>',
            [u'宛先 <*****@*****.**>'],
        )
        message_obj.encoding = 'cp932'
        message = message_obj.message()

        self.assertEquals(message['Subject'], '=?shift-jis?b?jI+WvA==?=')
Beispiel #3
0
    def test_email_message_iso_2022_jp_alias(self):
        message_obj = EmailMessage(
            u'件名',
            u'本文',
            u'差出人 <*****@*****.**>',
            [u'宛先 <*****@*****.**>'],
        )
        message_obj.encoding = 'iso2022jp'
        message = message_obj.message()

        self.assertEquals(message['Subject'],
                          '=?iso-2022-jp?b?GyRCN29MPhsoQg==?=')