summaryrefslogtreecommitdiff
path: root/src/mailman/mta/tests/test_connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/mta/tests/test_connection.py')
-rw-r--r--src/mailman/mta/tests/test_connection.py14
1 files changed, 14 insertions, 0 deletions
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')