-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from dusktreader/dusktreader/292--depdendency…
…-issues-with-pendulum-and-python-3.12 Issue #292: Added support for Python 3.12
- Loading branch information
Showing
7 changed files
with
366 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -934,7 +934,7 @@ def test_pack_header_for_user(self, app, user_class): | |
assert token_data["el_duderino"] == "not brief" | ||
|
||
def test_send_token_email__renders_an_email_template_and_sends_the_message_with_the_token( | ||
self, app, db, user_class, default_guard, | ||
self, app, db, user_class, default_guard, mail, | ||
): | ||
# create our default test user | ||
the_dude = user_class(username='TheDude') | ||
|
@@ -950,21 +950,20 @@ def test_send_token_email__renders_an_email_template_and_sends_the_message_with_ | |
</body> | ||
</html> | ||
""" | ||
with app.mail.record_messages() as outbox: | ||
notify = default_guard.send_token_email( | ||
email='[email protected]', | ||
template=template, | ||
action_sender='[email protected]', | ||
action_uri="action.mystery.com", | ||
subject="Have it your way, Dude", | ||
custom_token="sasparilla", | ||
) | ||
notify = default_guard.send_token_email( | ||
email='[email protected]', | ||
template=template, | ||
action_sender='[email protected]', | ||
action_uri="action.mystery.com", | ||
subject="Have it your way, Dude", | ||
custom_token="sasparilla", | ||
) | ||
|
||
token = notify['token'] | ||
token = notify['token'] | ||
|
||
# test our own interpretation and what we got back from flask_mail | ||
assert token in notify['message'] | ||
assert notify['message'] == outbox[0].html | ||
# test our own interpretation and what we got back from flask_mailman | ||
assert token in notify['message'] | ||
assert notify['message'] == app.extensions['mailman'].outbox[0].body | ||
|
||
def test_send_token_email__raises_exception_if_action_sender_is_not_defined( | ||
self, app, user_class, default_guard, | ||
|
@@ -1006,13 +1005,12 @@ def test_reset_email(self, app, user_class, db, tmpdir, default_guard): | |
db.session.add(the_dude) | ||
db.session.commit() | ||
|
||
with app.mail.record_messages() as outbox: | ||
notify = default_guard.send_reset_email("[email protected]", the_dude) | ||
token = notify['token'] | ||
notify = default_guard.send_reset_email("[email protected]", the_dude) | ||
token = notify['token'] | ||
|
||
# test our own interpretation and what we got back from flask_mail | ||
assert token in notify["message"] | ||
assert notify["message"] == outbox[0].html | ||
# test our own interpretation and what we got back from flask_mailman | ||
assert token in notify["message"] | ||
assert notify['message'] == app.extensions['mailman'].outbox[0].body | ||
|
||
# test our token is good | ||
jwt_data = default_guard.extract_jwt_token( | ||
|
@@ -1057,16 +1055,15 @@ def test_registration_email( | |
db.session.add(the_dude) | ||
db.session.commit() | ||
|
||
with app.mail.record_messages() as outbox: | ||
notify = default_guard.send_registration_email( | ||
'[email protected]', | ||
the_dude, | ||
) | ||
token = notify['token'] | ||
notify = default_guard.send_registration_email( | ||
'[email protected]', | ||
the_dude, | ||
) | ||
token = notify['token'] | ||
|
||
# test our own interpretation and what we got back from flask_mail | ||
assert token in notify["message"] | ||
assert notify["message"] == outbox[0].html | ||
# test our own interpretation and what we got back from flask_mailman | ||
assert token in notify["message"] | ||
assert notify['message'] == app.extensions['mailman'].outbox[0].body | ||
|
||
# test our token is good | ||
jwt_data = default_guard.extract_jwt_token( | ||
|