fixup! (back) add endpoint checking media status

This commit is contained in:
Manuel Raynaud 2025-05-22 06:41:51 +02:00
parent 7fe3287a14
commit 309710ca29
No known key found for this signature in database
GPG key ID: 3F45EEDEBF44E874
2 changed files with 3 additions and 3 deletions

View file

@ -1322,7 +1322,7 @@ class DocumentViewSet(
if key not in document.attachments:
return drf.response.Response(
{"detail": "Media not found"},
{"detail": "Attachment missing"},
status=drf.status.HTTP_404_NOT_FOUND,
)

View file

@ -56,7 +56,7 @@ def test_api_documents_media_check_key_parameter_not_related_to_document():
{"key": f"{document.id!s}/attachments/unknown.jpg"},
)
assert response.status_code == 404
assert response.json() == {"detail": "Media not found"}
assert response.json() == {"detail": "Attachment missing"}
def test_api_documents_media_check_anonymous_public_document():
@ -179,7 +179,7 @@ def test_api_documents_media_check_connected_document_media_not_related():
f"/api/v1.0/documents/{document.id!s}/media-check/", {"key": key}
)
assert response.status_code == 404
assert response.json() == {"detail": "Media not found"}
assert response.json() == {"detail": "Attachment missing"}
def test_api_documents_media_check_media_missing_on_storage():