extract enum type for tenant account role (#3788)

This commit is contained in:
Bowen Liang
2024-04-25 18:20:08 +08:00
committed by GitHub
parent cde87cb225
commit c54fcfb45d
6 changed files with 36 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
from models.account import TenantAccountRole
def test_account_is_privileged_role() -> None:
assert TenantAccountRole.ADMIN == 'admin'
assert TenantAccountRole.OWNER == 'owner'
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)
assert not TenantAccountRole.is_privileged_role('')