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
def test_rfc6532_address(): m = Message() m.mail_to = "anaï[email protected]" m.html = 'X' assert m.as_string()