Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

The fix for #16 is in repoze/repoze.sendmail#10.
  • Loading branch information...
commit 435fa7a188185eb162cb381b46a0a19869b8a684 1 parent c3928bf
Ross Patterson authored May 03, 2012

Showing 1 changed file with 23 additions and 0 deletions. Show diff stats Hide diff stats

  1. 23  pyramid_mailer/tests.py
23  pyramid_mailer/tests.py
@@ -419,6 +419,29 @@ def test_send_immediately_and_fail_silently(self):
419 419
                       body="test")
420 420
 
421 421
         mailer.send_immediately(msg, True)
  422
+
  423
+    def test_send_immediately_multipart(self):
  424
+
  425
+        from repoze.sendmail._compat import b
  426
+
  427
+        from pyramid_mailer.mailer import Mailer
  428
+        from pyramid_mailer.message import Message
  429
+
  430
+        mailer = Mailer()
  431
+
  432
+        utf_8_encoded = b('mo \xe2\x82\xac')
  433
+        utf_8 = utf_8_encoded.decode('utf_8')
  434
+
  435
+        text_string = utf_8
  436
+        html_string = '<p>'+utf_8+'</p>'
  437
+
  438
+        msg = Message(subject="testing",
  439
+                      sender="sender@example.com",
  440
+                      recipients=["tester@example.com"],
  441
+                      body=text_string,
  442
+                      html=html_string)
  443
+
  444
+        mailer.send_immediately(msg, True)
422 445
  
423 446
     def test_send(self):
424 447
 

0 notes on commit 435fa7a

Please sign in to comment.
Something went wrong with that request. Please try again.