From 02a0d1c9b00cafc67d708d10aaf44e2cf05fc80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Wed, 13 Apr 2016 14:01:36 +0100 Subject: [PATCH] minor reorder --- gluon/tests/test_tools.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gluon/tests/test_tools.py b/gluon/tests/test_tools.py index 62433d7f..53800e7b 100644 --- a/gluon/tests/test_tools.py +++ b/gluon/tests/test_tools.py @@ -134,6 +134,18 @@ class TestMail(unittest.TestCase): del TestMail.DummySMTP.users['username'] 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='')) + message = TestMail.DummySMTP.inbox.pop() + self.assertTrue('Content-Type: text/html' in message.payload) + def test_alternative(self): mail = Mail() 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('
HTML Only
' 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='')) - message = TestMail.DummySMTP.inbox.pop() - self.assertTrue('Content-Type: text/html' in message.payload) - def test_ssl(self): mail = Mail() mail.settings.server = 'smtp.example.com:25'