-
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.
Fix quickstart to show how to properly handle connections.
This is for the SQLAlchemy scoped session example which doesn't use Flask-SQLAlchemy
- Loading branch information
Showing
5 changed files
with
36 additions
and
8 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
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 |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
from unittest import mock | ||
import re | ||
import os.path | ||
import sys | ||
import time | ||
import typing as t | ||
|
||
|
@@ -809,7 +808,6 @@ def __init__(self, email): | |
""" | ||
|
||
|
||
@pytest.mark.skipif(sys.version_info < (3, 0), reason="requires python3 or higher") | ||
@pytest.mark.settings(password_check_breached="strict") | ||
def test_breached(app, sqlalchemy_datastore): | ||
# partial response from: https://api.pwnedpasswords.com/range/07003 | ||
|
@@ -833,7 +831,6 @@ def test_breached(app, sqlalchemy_datastore): | |
assert app.config["SECURITY_MSG_PASSWORD_BREACHED"][0] in pbad[0] | ||
|
||
|
||
@pytest.mark.skipif(sys.version_info < (3, 0), reason="requires python3 or higher") | ||
@pytest.mark.settings( | ||
password_check_breached="strict", | ||
password_breached_count=16, | ||
|
@@ -1444,3 +1441,20 @@ def test_login_email_whatever(app, client, get_message): | |
) | ||
assert response.status_code == 302 | ||
assert "/" in response.location | ||
|
||
|
||
@pytest.mark.skip | ||
def test_sqlalchemy_session_conn(request, app, tmpdir, realdburl): | ||
# test harness for checking connection mgmt by logging all connections | ||
from .conftest import sqlalchemy_session_setup | ||
|
||
ds = sqlalchemy_session_setup( | ||
request, app, tmpdir, realdburl, echo_pool="debug", echo="debug" | ||
) | ||
init_app_with_options(app, ds) | ||
client = app.test_client() | ||
|
||
client.post("/login", data=dict(email="[email protected]", password="password")) | ||
|
||
client.post("/login", json=dict(noemail="[email protected]", password="password")) | ||
time.sleep(5) |