From 149a7870bcdf4d1c96ab6450c454067c9a859cce Mon Sep 17 00:00:00 2001 From: -LAN- Date: Fri, 27 Feb 2026 15:27:30 +0800 Subject: [PATCH] test: align file preview mimetype expectation (#32688) --- .../services/test_webapp_auth_service.py | 6 +++--- .../unit_tests/controllers/files/test_image_preview.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 72b119b4ff..d1c566e477 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 fe3d9313b9..49846b89ee 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()