コード例 #1
0
def test_headers_not_double_encoded():

    TEXT = '웃'

    m = Message()
    m.mail_from = (TEXT, '[email protected]')
    m.mail_to = (TEXT, '[email protected]')
    m.subject = TEXT
    m.html = '...'
    msg = m.as_message()
    assert decode_header(parseaddr(msg['From'])[0]) == TEXT
    assert decode_header(parseaddr(msg['To'])[0]) == TEXT
    assert decode_header(msg['Subject']) == TEXT
コード例 #2
0
ファイル: test_message.py プロジェクト: lavr/python-emails
def test_headers_not_double_encoded():

    TEXT = '웃'

    m = Message()
    m.mail_from = (TEXT, '[email protected]')
    m.mail_to = (TEXT, '[email protected]')
    m.subject = TEXT
    m.html = '...'
    msg = m.as_message()
    assert decode_header(parseaddr(msg['From'])[0]) == TEXT
    assert decode_header(parseaddr(msg['To'])[0]) == TEXT
    assert decode_header(msg['Subject']) == TEXT
コード例 #3
0
def test_rfc6532_address():
    m = Message()
    m.mail_to = "anaï[email protected]"
    m.html = 'X'
    assert m.as_string()