Exemplo n.º 1
0
class MailServerTestCase(unittest.TestCase):
    """Test mail_server.py"""

    def setUp(self):
        """Initiate the smtp mail server"""
        self.server = MailServer(
            host="smtp.gmail.com", port=587, tls=True, account="*****@*****.**", password="******"
        )

    def test_send_mail(self):
        """send an email"""
        with self.server:
            self.server.send_mail(
                "*****@*****.**",
                "toolkit_library mail_server",
                "This message is sent via toolkit_library.mail_server",
            )
Exemplo n.º 2
0
 def setUp(self):
     """Initiate the smtp mail server"""
     self.server = MailServer(
         host="smtp.gmail.com", port=587, tls=True, account="*****@*****.**", password="******"
     )