-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore - fix tests to run w/o flask_sqlalchemy
Also - due to python version mismatch between tox and actions - a bunch of actions were being skipped. Have more tests run using all available datastores (rather than the normal just flask_sqlalchemy). A bit of cleanup prior to adding the new flask_sqlalchemy_lite datastore.
- Loading branch information
Showing
11 changed files
with
44 additions
and
22 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
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 |
---|---|---|
|
@@ -47,7 +47,9 @@ def _on(app, **data): | |
|
||
|
||
@pytest.mark.settings(change_email_error_view="/change-email") | ||
def test_ce(app, client, get_message): | ||
def test_ce(app, clients, get_message): | ||
client = clients | ||
|
||
@change_email_confirmed.connect_via(app) | ||
def _on(app, **kwargs): | ||
assert kwargs["old_email"] == "[email protected]" | ||
|
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
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 |
---|---|---|
|
@@ -517,7 +517,8 @@ def test_form_error(app, client, get_message): | |
|
||
@pytest.mark.settings(username_enable=True) | ||
@pytest.mark.unified_signin() | ||
def test_username(app, client, get_message): | ||
def test_username(app, clients, get_message): | ||
client = clients | ||
data = dict( | ||
email="[email protected]", | ||
username="dude", | ||
|
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 |
---|---|---|
|
@@ -305,9 +305,10 @@ def test_two_factor_illegal_state(app, client, get_message): | |
|
||
|
||
@pytest.mark.settings(two_factor_required=True) | ||
def test_two_factor_flag(app, client, get_message): | ||
def test_two_factor_flag(app, clients, get_message): | ||
# trying to verify code without going through two-factor | ||
# first login function | ||
client = clients | ||
wrong_code = b"000000" | ||
response = client.post( | ||
"/tf-validate", data=dict(code=wrong_code), follow_redirects=True | ||
|
@@ -1113,8 +1114,9 @@ def test_admin_setup_reset(app, client, get_message): | |
|
||
|
||
@pytest.mark.settings(two_factor_required=True) | ||
def test_datastore(app, client, get_message): | ||
def test_datastore(app, clients, get_message): | ||
# Test that user record is properly set after proper 2FA setup. | ||
client = clients | ||
sms_sender = SmsSenderFactory.createSender("test") | ||
data = dict(email="[email protected]", password="password") | ||
response = client.post( | ||
|
@@ -1335,6 +1337,7 @@ def test_bad_sender(app, client, get_message): | |
|
||
def test_replace_send_code(app, get_message): | ||
pytest.importorskip("sqlalchemy") | ||
pytest.importorskip("flask_sqlalchemy") | ||
|
||
# replace tf_send_code - and have it return an error to check that. | ||
from flask_sqlalchemy import SQLAlchemy | ||
|
@@ -1489,6 +1492,7 @@ def test_setup_nofresh(app, client, get_message): | |
@pytest.mark.settings(two_factor_enabled_methods=["email"]) | ||
def test_no_sms(app, get_message): | ||
pytest.importorskip("sqlalchemy") | ||
pytest.importorskip("flask_sqlalchemy") | ||
|
||
# Make sure that don't require tf_phone_number if SMS isn't an option. | ||
from sqlalchemy import ( | ||
|
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