From 01c85a2acddf0e6a1a95262e2dc2f79e3c3f9e75 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 22 Jun 2015 18:39:45 -0400 Subject: Port to Python 3.5. --- src/mailman/mta/tests/test_connection.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mailman/mta/tests/test_connection.py') diff --git a/src/mailman/mta/tests/test_connection.py b/src/mailman/mta/tests/test_connection.py index 6e167497e..a3a830330 100644 --- a/src/mailman/mta/tests/test_connection.py +++ b/src/mailman/mta/tests/test_connection.py @@ -49,3 +49,17 @@ Subject: aardvarks """) self.assertEqual(cm.exception.smtp_code, 571) self.assertEqual(cm.exception.smtp_error, b'Bad authentication') + + def test_authentication_good_path(self): + # Logging in with the correct user name and password succeeds. + connection = Connection( + config.mta.smtp_host, int(config.mta.smtp_port), 0, + 'testuser', 'testpass') + connection.sendmail('anne@example.com', ['bart@example.com'], """\ +From: anne@example.com +To: bart@example.com +Subject: aardvarks + +""") + self.assertEqual(self.layer.smtpd.get_authentication_credentials(), + 'AHRlc3R1c2VyAHRlc3RwYXNz') -- cgit v1.2.3-70-g09d2