X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Ftests%2Futils.py;h=02e0523bc9dfa4147eab1b4c4a403c85657f22e0;hb=112de5d5dc557dc660701a6686dbd47033bff19e;hp=7166ed27ccdc0fdb7bdb11fce584fab3e2f0c05d;hpb=1dbc5bbbf795b6ae572e3aba8f4e2ce9ba4e94a1;p=patchwork 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