From 20c16107e8c6f7984eb803d461843ebf753b806a Mon Sep 17 00:00:00 2001 From: Joe Hand Date: Sun, 22 Sep 2013 09:55:07 -0600 Subject: [PATCH] Add test for 'SECURITY_SEND_PASSWORD_CHANGE_EMAIL' configuration --- tests/configured_tests.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/configured_tests.py b/tests/configured_tests.py index e2220a4..7ab132b 100644 --- a/tests/configured_tests.py +++ b/tests/configured_tests.py @@ -493,6 +493,28 @@ class ChangePasswordTest(SecurityTest): self.assertIn("/reset", outbox[0].html) +class SendEmailTest(SecurityTest): + + AUTH_CONFIG = { + 'SECURITY_SEND_REGISTER_EMAIL': False, + 'SECURITY_SEND_PASSWORD_CHANGE_EMAIL': False, + } + + + def test_change_password_success(self): + data = { + 'password': 'password', + 'new_password': 'newpassword', + 'new_password_confirm': 'newpassword' + } + + self.authenticate() + with self.app.extensions['mail'].record_messages() as outbox: + r = self._post('/change', data=data, follow_redirects=True) + + self.assertEqual(len(outbox), 0) + + class ChangePasswordPostViewTest(SecurityTest): AUTH_CONFIG = {