about summary refs log tree commit diff
path: root/tests/unit/auth/test_resources.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-13 14:06:05 +0300
committerFrederick Muriuki Muriithi2023-09-26 03:44:30 +0300
commit345e33fc8e1b12dda6626307ebac7e1206200974 (patch)
tree2f5f2f4b4fbfc293522cdbd5a89725108a77e0f3 /tests/unit/auth/test_resources.py
parent37771b3be3142f705101beb4c5dc34c1000962f9 (diff)
downloadgn-auth-345e33fc8e1b12dda6626307ebac7e1206200974.tar.gz
Update tests & fixtures to conform to schema changes
Diffstat (limited to 'tests/unit/auth/test_resources.py')
-rw-r--r--tests/unit/auth/test_resources.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/unit/auth/test_resources.py b/tests/unit/auth/test_resources.py
index 7018e73..57ccc1d 100644
--- a/tests/unit/auth/test_resources.py
+++ b/tests/unit/auth/test_resources.py
@@ -28,7 +28,7 @@ create_resource_failure = {
     tuple(zip(
         conftest.TEST_USERS[0:1],
         (Resource(
-            group, uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b"),
+            uuid.UUID("d32611e3-07fc-4564-b56c-786c6db6de2b"),
             "test_resource", resource_category, False),))))
 def test_create_resource(mocker, fxtr_users_in_group, user, expected):
     """Test that resource creation works as expected."""
@@ -43,11 +43,14 @@ def test_create_resource(mocker, fxtr_users_in_group, user, expected):
     with db.cursor(conn) as cursor:
         # Cleanup
         cursor.execute(
-            "DELETE FROM group_user_roles_on_resources WHERE resource_id=?",
+            "DELETE FROM user_roles WHERE resource_id=?",
+            (str(resource.resource_id),))
+        cursor.execute(
+            "DELETE FROM resource_ownership WHERE resource_id=?",
             (str(resource.resource_id),))
         cursor.execute(
             "DELETE FROM group_roles WHERE group_id=?",
-            (str(resource.group.group_id),))
+            (str(group.group_id),))
         cursor.execute(
             "DELETE FROM resources WHERE resource_id=?",
             (str(resource.resource_id),))