Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport master] Use with statement for the SMTP connection #11747

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions admin/tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_unicity_validator(self, users_test_data, test_app):
@patch("c2cgeoportal_admin.views.users.pwgenerator.generate")
def test_duplicate(self, pw_gen_mock, smtp_mock, users_test_data, test_app, dbsession):
sender_mock = MagicMock()
smtp_mock.return_value = sender_mock
smtp_mock.return_value.__enter__.return_value = sender_mock
pw_gen_mock.return_value = "basile"
from c2cgeoportal_commons.models.static import User

Expand Down Expand Up @@ -259,7 +259,7 @@ def test_submit_new(self, pw_gen_mock, smtp_mock, dbsession, test_app, users_tes
from c2cgeoportal_commons.models.static import Log, User

sender_mock = MagicMock()
smtp_mock.return_value = sender_mock
smtp_mock.return_value.__enter__.return_value = sender_mock
pw_gen_mock.return_value = "basile"

roles = users_test_data["roles"]
Expand Down
Loading
Loading