Skip to content

Commit d76c40f

Browse files
Fixed mypy lint error
1 parent d23d522 commit d76c40f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_role.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# test_role.py
22

33
import pytest
4+
from conftest import SetupError
45
from utils.models import Role, Permission, ValidPermissions, User
56
from sqlmodel import Session, select
67

@@ -154,6 +155,9 @@ def test_update_role_success(auth_client, editor_user, test_organization, sessio
154155
perm_create = session.exec(
155156
select(Permission).where(Permission.name == ValidPermissions.CREATE_ROLE)
156157
).first()
158+
if not perm_create:
159+
raise SetupError("Test setup failed; CREATE_ROLE permission not found.")
160+
157161
existing_role.permissions.append(perm_create)
158162
session.commit()
159163

0 commit comments

Comments
 (0)