test: stub current_account_with_tenant in FilePreviewApi test

The tenant-scoping fix calls current_account_with_tenant() in
FilePreviewApi.get, which hits flask-login and trips on a Flask app
without login_manager configured. Reuse the existing
mock_account_context fixture to short-circuit it.
This commit is contained in:
xr843 2026-05-09 12:38:20 +08:00
parent 06fcde7298
commit 61f1350782

View File

@ -278,7 +278,7 @@ class TestFileApiPost:
class TestFilePreviewApi:
def test_get_preview(self, app, mock_file_service):
def test_get_preview(self, app, mock_account_context, mock_file_service):
api = FilePreviewApi()
get_method = unwrap(api.get)
mock_file_service.get_file_preview.return_value = "preview text"