mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 21:28:25 +08:00
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:
parent
06fcde7298
commit
61f1350782
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user