Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test: align file preview mimetype expectation (#32688)

-LAN-149a7870bcdf
diff --git a/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py b/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
index 72b119b4fff..d1c566e4774 100644
--- a/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
+++ b/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
@@ -273,9 +273,10 @@ class TestWebAppAuthService:
# Arrange: Create banned account
fake = Faker()
password = fake.password(length=12)
+ unique_email = f"test_{uuid.uuid4().hex[:8]}@example.com"
account = Account(
- email=fake.email(),
+ email=unique_email,
name=fake.name(),
interface_language="en-US",
status=AccountStatus.BANNED,
@@ -426,8 +427,7 @@ class TestWebAppAuthService:
- Correct return value (None)
"""
# Arrange: Use non-existent email
- fake = Faker()
- non_existent_email = fake.email()
+ non_existent_email = f"nonexistent_{uuid.uuid4().hex}@example.com"
# Act: Execute user retrieval
result = WebAppAuthService.get_user_through_email(non_existent_email)
diff --git a/api/tests/unit_tests/controllers/files/test_image_preview.py b/api/tests/unit_tests/controllers/files/test_image_preview.py
index fe3d9313b99..49846b89ee9 100644
--- a/api/tests/unit_tests/controllers/files/test_image_preview.py
+++ b/api/tests/unit_tests/controllers/files/test_image_preview.py
@@ -107,7 +107,7 @@ class TestFilePreviewApi:
response = get_fn("file-id")
- assert response.mimetype == "text/plain"
+ assert response.mimetype == "application/octet-stream"
assert response.headers["Content-Length"] == "100"
assert "Accept-Ranges" not in response.headers
mock_enforce.assert_called_once()