about summary refs log tree commit diff
path: root/tests/unit/auth/test_resources.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-07-29 14:29:33 -0500
committerFrederick Muriuki Muriithi2025-07-29 14:29:33 -0500
commit2402dcf7577961c634bc36181b26803dff785c11 (patch)
treecd046df8e184c876e0680940a81e881b707d511b /tests/unit/auth/test_resources.py
parent6981414dd8e713b7b910912979dbaa7ee98cfa6c (diff)
downloadgn-auth-2402dcf7577961c634bc36181b26803dff785c11.tar.gz
Pass connection object rather than cursor object.
Diffstat (limited to 'tests/unit/auth/test_resources.py')
-rw-r--r--tests/unit/auth/test_resources.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/unit/auth/test_resources.py b/tests/unit/auth/test_resources.py
index 292f7dc..04da6df 100644
--- a/tests/unit/auth/test_resources.py
+++ b/tests/unit/auth/test_resources.py
@@ -50,7 +50,7 @@ def test_create_resource(# pylint: disable=[too-many-arguments, too-many-positio
 
     with db.cursor(conn) as cursor:
         resource = create_resource(
-            cursor, "test_resource", resource_category, user, _group, False)
+            conn, "test_resource", resource_category, user, _group, False)
         assert resource == expected
         # Cleanup
         cursor.execute(
@@ -82,15 +82,14 @@ def test_create_resource_raises_for_unauthorised_users(
             tuple(client for client in clients if client.user == user)[0]))
     conn, _group, _users = fxtr_users_in_group
     with pytest.raises(AuthorisationError):
-        with db.cursor(conn) as cursor:
-            assert create_resource(
-                cursor,
-                "test_resource",
-                resource_category,
-                user,
-                _group,
-                False
-            ) == expected
+        assert create_resource(
+            conn,
+            "test_resource",
+            resource_category,
+            user,
+            _group,
+            False
+        ) == expected
 
 def sort_key_resources(resource):
     """Sort-key for resources."""