diff options
author | Frederick Muriuki Muriithi | 2022-11-15 03:49:28 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-11-15 03:49:28 +0300 |
commit | f640f3f97e7ee646886b29470f2f4cb32af323c7 (patch) | |
tree | a0eb68c73305559cc2601de1033615666dd8b6b2 /tests/unit/auth/test_groups.py | |
parent | 6b964b95a67bac69a1217b3f9c39c58a19881df4 (diff) | |
download | genenetwork3-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/unit/auth/test_groups.py')
-rw-r--r-- | tests/unit/auth/test_groups.py | 2 |
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 |