Allegati delle note verso /api/task-results/attachments (#55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VNVrf2wZAmMAkgmwEuBB36
This commit is contained in:
@@ -935,7 +935,7 @@ def api_upload_attachment():
|
|||||||
if upload is None or not upload.filename:
|
if upload is None or not upload.filename:
|
||||||
return jsonify({"error": True, "detail": _("Nessun file caricato")}), 400
|
return jsonify({"error": True, "detail": _("Nessun file caricato")}), 400
|
||||||
resp = api_client.post(
|
resp = api_client.post(
|
||||||
"/api/files/upload",
|
"/api/task-results/attachments", # #55: upload per l operatore (files/upload e solo Maker)
|
||||||
files={"file": (
|
files={"file": (
|
||||||
upload.filename,
|
upload.filename,
|
||||||
upload.read(),
|
upload.read(),
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ def test_attachment_upload_forwards_multipart(logged_in_client, mock_api_client)
|
|||||||
assert resp.status_code == 201
|
assert resp.status_code == 201
|
||||||
assert resp.get_json()["file_path"] == "general/foto.png"
|
assert resp.get_json()["file_path"] == "general/foto.png"
|
||||||
args, kwargs = mock_api_client.post.call_args
|
args, kwargs = mock_api_client.post.call_args
|
||||||
assert args[0] == "/api/files/upload"
|
assert args[0] == "/api/task-results/attachments" # #55
|
||||||
name, content, mime = kwargs["files"]["file"]
|
name, content, mime = kwargs["files"]["file"]
|
||||||
assert name == "foto.png" and mime == "image/png" and content.startswith(b"\x89PNG")
|
assert name == "foto.png" and mime == "image/png" and content.startswith(b"\x89PNG")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user