Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coverage for multipart non-ascii messages for #16 #17

Merged
merged 1 commit into from
May 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pyramid_mailer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,29 @@ def test_send_immediately_and_fail_silently(self):
body="test")

mailer.send_immediately(msg, True)

def test_send_immediately_multipart(self):

from repoze.sendmail._compat import b

from pyramid_mailer.mailer import Mailer
from pyramid_mailer.message import Message

mailer = Mailer()

utf_8_encoded = b('mo \xe2\x82\xac')
utf_8 = utf_8_encoded.decode('utf_8')

text_string = utf_8
html_string = '<p>'+utf_8+'</p>'

msg = Message(subject="testing",
sender="sender@example.com",
recipients=["tester@example.com"],
body=text_string,
html=html_string)

mailer.send_immediately(msg, True)

def test_send(self):

Expand Down