minor reorder
This commit is contained in:
+12
-12
@@ -134,6 +134,18 @@ class TestMail(unittest.TestCase):
|
|||||||
del TestMail.DummySMTP.users['username']
|
del TestMail.DummySMTP.users['username']
|
||||||
TestMail.DummySMTP.inbox.pop()
|
TestMail.DummySMTP.inbox.pop()
|
||||||
|
|
||||||
|
def test_html(self):
|
||||||
|
mail = Mail()
|
||||||
|
mail.settings.server = 'smtp.example.com:25'
|
||||||
|
mail.settings.sender = 'you@example.com'
|
||||||
|
self.assertTrue(mail.send(to=['somebody@example.com'],
|
||||||
|
subject='hello',
|
||||||
|
# If reply_to is omitted, then mail.settings.sender is used
|
||||||
|
reply_to='us@example.com',
|
||||||
|
message='<html><head></head><body></body></html>'))
|
||||||
|
message = TestMail.DummySMTP.inbox.pop()
|
||||||
|
self.assertTrue('Content-Type: text/html' in message.payload)
|
||||||
|
|
||||||
def test_alternative(self):
|
def test_alternative(self):
|
||||||
mail = Mail()
|
mail = Mail()
|
||||||
mail.settings.server = 'smtp.example.com:25'
|
mail.settings.server = 'smtp.example.com:25'
|
||||||
@@ -147,18 +159,6 @@ class TestMail(unittest.TestCase):
|
|||||||
self.assertTrue('Text only' in parts[0].as_string())
|
self.assertTrue('Text only' in parts[0].as_string())
|
||||||
self.assertTrue('<html><pre>HTML Only</pre></html>' in parts[1].as_string())
|
self.assertTrue('<html><pre>HTML Only</pre></html>' in parts[1].as_string())
|
||||||
|
|
||||||
def test_html(self):
|
|
||||||
mail = Mail()
|
|
||||||
mail.settings.server = 'smtp.example.com:25'
|
|
||||||
mail.settings.sender = 'you@example.com'
|
|
||||||
self.assertTrue(mail.send(to=['somebody@example.com'],
|
|
||||||
subject='hello',
|
|
||||||
# If reply_to is omitted, then mail.settings.sender is used
|
|
||||||
reply_to='us@example.com',
|
|
||||||
message='<html><head></head><body></body></html>'))
|
|
||||||
message = TestMail.DummySMTP.inbox.pop()
|
|
||||||
self.assertTrue('Content-Type: text/html' in message.payload)
|
|
||||||
|
|
||||||
def test_ssl(self):
|
def test_ssl(self):
|
||||||
mail = Mail()
|
mail = Mail()
|
||||||
mail.settings.server = 'smtp.example.com:25'
|
mail.settings.server = 'smtp.example.com:25'
|
||||||
|
|||||||
Reference in New Issue
Block a user