diff --git a/tests/unit/test_email.py b/tests/unit/test_email.py index 2ebc879..4b3fc0e 100644 --- a/tests/unit/test_email.py +++ b/tests/unit/test_email.py @@ -84,7 +84,7 @@ def handle_message(self, message): @pytest.fixture() def smtp_server(): - controller = Controller(CustomMessageHandler(), hostname='localhost', port=1025) + controller = Controller(CustomMessageHandler(), hostname='127.0.0.1', port=1025) thread = threading.Thread(target=controller.start) thread.start() @@ -97,31 +97,6 @@ def smtp_server(): def test_send_plain_text_email_with_mock_smtp_server(smtp_server): smtp_config = SMTPConfig(smtp_server.hostname, smtp_server.port, "user", "pass") - try: - success = send_email( - smtp=smtp_config, - from_addr=TEST_FROM_EMAIL, - to_addr=TEST_TO_EMAIL, - subject=TEST_SUBJECT, - body=TEST_BODY) - - # assert success - except Exception as e: - print(e) - - # msg = CustomMessageHandler.received_message - # CustomMessageHandler.received_message = None - - # assert msg is not None - # assert msg['From'] == TEST_FROM_EMAIL - # assert msg['To'] == TEST_TO_EMAIL - # assert msg['Subject'] == TEST_SUBJECT - # assert TEST_BODY in msg.get_payload() - - -def test_send_plain_text_email_with_mock_smtp_server_2(smtp_server): - smtp_config = SMTPConfig(smtp_server.hostname, smtp_server.port, "user", "pass") - success = send_email( smtp=smtp_config, from_addr=TEST_FROM_EMAIL,