mirror of https://github.com/langgenius/dify.git
refactor(tests): use enum values instead of string literals for status fields (#33441)
This commit is contained in:
parent
e64f4d6039
commit
79a8747c1b
|
|
@ -18,7 +18,7 @@ from faker import Faker
|
|||
|
||||
from core.rag.pipeline.queue import TaskWrapper, TenantIsolatedTaskQueue
|
||||
from extensions.ext_redis import redis_client
|
||||
from models import Account, Tenant, TenantAccountJoin, TenantAccountRole
|
||||
from models import Account, AccountStatus, Tenant, TenantAccountJoin, TenantAccountRole, TenantStatus
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
@ -47,7 +47,7 @@ class TestTenantIsolatedTaskQueueIntegration:
|
|||
email=fake.email(),
|
||||
name=fake.name(),
|
||||
interface_language="en-US",
|
||||
status="active",
|
||||
status=AccountStatus.ACTIVE,
|
||||
)
|
||||
db_session_with_containers.add(account)
|
||||
db_session_with_containers.commit()
|
||||
|
|
@ -55,7 +55,7 @@ class TestTenantIsolatedTaskQueueIntegration:
|
|||
# Create tenant
|
||||
tenant = Tenant(
|
||||
name=fake.company(),
|
||||
status="normal",
|
||||
status=TenantStatus.NORMAL,
|
||||
)
|
||||
db_session_with_containers.add(tenant)
|
||||
db_session_with_containers.commit()
|
||||
|
|
@ -101,7 +101,7 @@ class TestTenantIsolatedTaskQueueIntegration:
|
|||
# Create second tenant
|
||||
tenant2 = Tenant(
|
||||
name=fake.company(),
|
||||
status="normal",
|
||||
status=TenantStatus.NORMAL,
|
||||
)
|
||||
db_session_with_containers.add(tenant2)
|
||||
db_session_with_containers.commit()
|
||||
|
|
@ -410,7 +410,7 @@ class TestTenantIsolatedTaskQueueCompatibility:
|
|||
email=fake.email(),
|
||||
name=fake.name(),
|
||||
interface_language="en-US",
|
||||
status="active",
|
||||
status=AccountStatus.ACTIVE,
|
||||
)
|
||||
db_session_with_containers.add(account)
|
||||
db_session_with_containers.commit()
|
||||
|
|
@ -418,7 +418,7 @@ class TestTenantIsolatedTaskQueueCompatibility:
|
|||
# Create tenant
|
||||
tenant = Tenant(
|
||||
name=fake.company(),
|
||||
status="normal",
|
||||
status=TenantStatus.NORMAL,
|
||||
)
|
||||
db_session_with_containers.add(tenant)
|
||||
db_session_with_containers.commit()
|
||||
|
|
|
|||
Loading…
Reference in New Issue