Permalink
Browse files

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

The fix for #16 is in repoze/repoze.sendmail#10.
  • Loading branch information...
1 parent c3928bf commit 435fa7a188185eb162cb381b46a0a19869b8a684 @rpatterson committed May 3, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 pyramid_mailer/tests.py
@@ -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):

0 comments on commit 435fa7a

Please sign in to comment.