aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2010-08-10 11:41:58 +0800
committerJeremy Kerr <jk@ozlabs.org>2010-08-10 11:49:36 +0800
commit112de5d5dc557dc660701a6686dbd47033bff19e (patch)
treef0a8998afb2ae1bb1e2b8361de1ceb397559ea77
parent1dbc5bbbf795b6ae572e3aba8f4e2ce9ba4e94a1 (diff)
downloadpatchwork-112de5d5dc557dc660701a6686dbd47033bff19e.tar
patchwork-112de5d5dc557dc660701a6686dbd47033bff19e.tar.gz
tests/utils: Specify content encoding on MIMEText() construction
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--apps/patchwork/tests/utils.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/patchwork/tests/utils.py b/apps/patchwork/tests/utils.py
index 7166ed2..02e0523 100644
--- a/apps/patchwork/tests/utils.py
+++ b/apps/patchwork/tests/utils.py
@@ -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