Skip to content
Snippets Groups Projects
Commit 1aebf8a0 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

fix pytest complaining about mock function

parent 97a63a0e
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ def decode_message(msg: MIMEMultipart):
@contextmanager
def test_user(app):
def mock_user(app):
with app.app_context():
app.config['MAIL_ENABLE'] = True
app.config['MAIL_SERVER'] = 'localhost'
......@@ -52,7 +52,7 @@ def test_signup_email_admin(app, mocked_admin_user, mocker):
mocker.patch('compendium_v2.email._send_mail', _send_mail)
mocker.patch('compendium_v2.email.Thread', MockedThread)
with test_user(app) as user:
with mock_user(app) as user:
send_admin_signup_notification(user)
......@@ -69,5 +69,5 @@ def test_signup_email_user(app, mocker):
mocker.patch('compendium_v2.email._send_mail', _send_mail)
mocker.patch('threading.Thread', MockedThread)
with test_user(app) as user:
with mock_user(app) as user:
send_user_signup_notification(user, 'testname')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment