Commit 112de5d5 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

tests/utils: Specify content encoding on MIMEText() construction


Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent 1dbc5bbb
......@@ -92,17 +92,16 @@ def create_email(content, subject = None, sender = None, multipart = False,
sender = defaults.sender
if project is None:
project = defaults.project
if content_encoding is None:
content_encoding = 'us-ascii'
if multipart:
msg = MIMEMultipart()
body = MIMEText(content, _subtype = 'plain')
if content_encoding is not None:
body.set_charset(content_encoding)
body = MIMEText(content, _subtype = 'plain',
_charset = content_encoding)
msg.attach(body)
else:
msg = MIMEText(content)
if content_encoding is not None:
msg.set_charset(content_encoding)
msg = MIMEText(content, _charset = content_encoding)
msg['Subject'] = subject
msg['From'] = sender
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment