aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-11-15 03:49:28 +0300
committerFrederick Muriuki Muriithi2022-11-15 03:49:28 +0300
commitf640f3f97e7ee646886b29470f2f4cb32af323c7 (patch)
treea0eb68c73305559cc2601de1033615666dd8b6b2 /tests
parent6b964b95a67bac69a1217b3f9c39c58a19881df4 (diff)
downloadgenenetwork3-f640f3f97e7ee646886b29470f2f4cb32af323c7.tar.gz
tests: Fix cause of `DeprecationWarning`
* tests/unit/auth/test_groups.py: use Flask's application context directly rather than the request context to access `g` in order to get rid of the `DeprecationWarning`.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/auth/test_groups.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/auth/test_groups.py b/tests/unit/auth/test_groups.py
index 18abbc6..ac575d0 100644
--- a/tests/unit/auth/test_groups.py
+++ b/tests/unit/auth/test_groups.py
@@ -28,7 +28,7 @@ group_leader_id = lambda : UUID("d32611e3-07fc-4564-b56c-786c6db6de2b")
("e614247d-84d2-491d-a048-f80b578216cb", create_group_failure)))
def test_create_group(test_app, auth_testdb_path, mocker, test_users, user_id, expected):
mocker.patch("gn3.auth.authorisation.groups.uuid.uuid4", group_leader_id)
- with test_app.test_request_context() as flask_context:
+ with test_app.app_context() as flask_context:
flask_context.g.user_id = UUID(user_id)
with db.connection(auth_testdb_path) as conn:
assert create_group(conn, "a_test_group") == expected