diff options
author | Frederick Muriuki Muriithi | 2022-11-17 14:03:19 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-11-17 14:03:19 +0300 |
commit | 8e0ed6fdb03d1a2c284a68a387105623c8947abd (patch) | |
tree | 2748c4dd713bce099565c02569463553f293beb9 /tests/unit/auth/conftest.py | |
parent | fb885e810f568a69e6703939062e532acf649a38 (diff) | |
download | genenetwork3-8e0ed6fdb03d1a2c284a68a387105623c8947abd.tar.gz |
auth: Finish implementation of `create_group_role`
* gn3/auth/authorisation/groups.py: Add `GroupRole` type. Fix typing
annotations. Fix bugs.
* tests/unit/auth/conftest.py: Fix bugs.
* tests/unit/auth/test_groups.py: Fix test to run.
Diffstat (limited to 'tests/unit/auth/conftest.py')
-rw-r--r-- | tests/unit/auth/conftest.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/auth/conftest.py b/tests/unit/auth/conftest.py index 4f4f1f8..37d78a3 100644 --- a/tests/unit/auth/conftest.py +++ b/tests/unit/auth/conftest.py @@ -101,22 +101,22 @@ def test_users(conn_after_auth_migrations):# pylint: disable=[redefined-outer-na ("9a0c7ce5-2f40-4e78-979e-bf3527a59579",))) @pytest.fixture(scope="function") -def test_users_in_group(test_group, test_users):#pytest: disable=[redefined-outer-name] +def test_users_in_group(test_group, test_users):# pylint: disable=[redefined-outer-name] """Link the users to the groups.""" conn = test_group[0] group = test_group[1] users = test_users[1] - query_params = ( + query_params = tuple( (str(group.group_id), str(user.user_id)) for user in users if user.email not in ("unaff@iliated.user",)) with db.cursor(conn) as cursor: - cursor.execute( + cursor.executemany( "INSERT INTO group_users(group_id, user_id) VALUES (?, ?)", query_params) yield (conn, group, users) with db.cursor(conn) as cursor: - cursor.execute( + cursor.executemany( "DELETE FROM group_users WHERE group_id=? AND user_id=?", query_params) |