Permalink
Browse files

2.5 tests

  • Loading branch information...
1 parent 7b74cea commit 08af07f885307954c18e135820da7808c9a71902 @danjac danjac committed Feb 11, 2011
Showing with 11 additions and 2 deletions.
  1. +11 −2 pyramid_mailer/tests.py
View
13 pyramid_mailer/tests.py
@@ -349,11 +349,20 @@ def test_send_to_queue(self):
def test_use_ssl_mailer(self):
- from smtplib import SMTP_SSL
+ try:
+ from smtplib import SMTP_SSL
+ ssl_enabled = True
+ except ImportError:
+ from smtplib import SMTP
+ ssl_enabled = False
from pyramid_mailer.mailer import Mailer
mailer = Mailer(ssl=True)
- self.assert_(mailer.direct_delivery.mailer.smtp == SMTP_SSL)
+ if ssl_enabled:
+ self.assert_(mailer.direct_delivery.mailer.smtp == SMTP_SSL)
+ else:
+ self.assert_(mailer.direct_delivery.mailer.smtp == SMTP)
+
def test_from_settings(self):

0 comments on commit 08af07f

Please sign in to comment.