test: align file preview mimetype expectation (#32688)

This commit is contained in:
-LAN- 2026-02-27 15:27:30 +08:00 committed by GitHub
parent 661af404e9
commit 149a7870bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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()