From 61f13507829018ae61b8772ca77a4517766c1c00 Mon Sep 17 00:00:00 2001 From: xr843 <137012659+xr843@users.noreply.github.com> Date: Sat, 9 May 2026 12:38:20 +0800 Subject: [PATCH] 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. --- api/tests/unit_tests/controllers/console/test_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tests/unit_tests/controllers/console/test_files.py b/api/tests/unit_tests/controllers/console/test_files.py index 5df9daa7f8..9acf68dfc3 100644 --- a/api/tests/unit_tests/controllers/console/test_files.py +++ b/api/tests/unit_tests/controllers/console/test_files.py @@ -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"