2024-04-25 18:20:08 +08:00
|
|
|
from models.account import TenantAccountRole
|
|
|
|
|
|
|
|
|
|
|
|
def test_account_is_privileged_role() -> None:
|
|
|
|
assert TenantAccountRole.ADMIN == 'admin'
|
|
|
|
assert TenantAccountRole.OWNER == 'owner'
|
2024-06-14 20:34:25 +08:00
|
|
|
assert TenantAccountRole.EDITOR == 'editor'
|
2024-04-25 18:20:08 +08:00
|
|
|
assert TenantAccountRole.NORMAL == 'normal'
|
|
|
|
|
|
|
|
assert TenantAccountRole.is_privileged_role(TenantAccountRole.ADMIN)
|
|
|
|
assert TenantAccountRole.is_privileged_role(TenantAccountRole.OWNER)
|
|
|
|
assert not TenantAccountRole.is_privileged_role(TenantAccountRole.NORMAL)
|
2024-06-14 20:34:25 +08:00
|
|
|
assert not TenantAccountRole.is_privileged_role(TenantAccountRole.EDITOR)
|
2024-04-25 18:20:08 +08:00
|
|
|
assert not TenantAccountRole.is_privileged_role('')
|