mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Fix smtp sendmail (#781)
* Fix setting mail_username, mail_password; Fix setting auth for get_smtp * Add MAIL_USEAUTH to config.py * Add more mail documentation to config.py * Prevent overriding smtp attributes on config update; update email tests to use mail_userauth
This commit is contained in:
@@ -179,6 +179,7 @@ def test_expired_reset_password_link():
|
||||
with app.app_context():
|
||||
set_config('mail_server', 'localhost')
|
||||
set_config('mail_port', 25)
|
||||
set_config('mail_useauth', True)
|
||||
set_config('mail_username', 'username')
|
||||
set_config('mail_password', 'password')
|
||||
|
||||
@@ -199,6 +200,7 @@ def test_invalid_reset_password_link():
|
||||
with app.app_context():
|
||||
set_config('mail_server', 'localhost')
|
||||
set_config('mail_port', 25)
|
||||
set_config('mail_useauth', True)
|
||||
set_config('mail_username', 'username')
|
||||
set_config('mail_password', 'password')
|
||||
|
||||
@@ -237,6 +239,7 @@ def test_user_can_confirm_email(mock_smtp):
|
||||
set_config('verify_emails', True)
|
||||
set_config('mail_server', 'localhost')
|
||||
set_config('mail_port', 25)
|
||||
set_config('mail_useauth', True)
|
||||
set_config('mail_username', 'username')
|
||||
set_config('mail_password', 'password')
|
||||
|
||||
@@ -279,6 +282,7 @@ def test_user_can_reset_password(mock_smtp):
|
||||
# Set CTFd to send emails
|
||||
set_config('mail_server', 'localhost')
|
||||
set_config('mail_port', 25)
|
||||
set_config('mail_useauth', True)
|
||||
set_config('mail_username', 'username')
|
||||
set_config('mail_password', 'password')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user