diff --git a/backend/tests/test_audit.py b/backend/tests/test_audit.py index 2b8bf94..2b0e59e 100644 --- a/backend/tests/test_audit.py +++ b/backend/tests/test_audit.py @@ -313,6 +313,7 @@ async def test_daily_exports_list(async_client, admin_user): async def test_daily_export_download(async_client, admin_user): """GET /api/admin/audit-log/daily-exports/{date} returns CSV bytes with Content-Disposition (D-16)""" from unittest.mock import MagicMock, patch + from storage.minio_backend import MinIOBackend fake_csv = b"id,event_type,user_id\n1,document.uploaded,abc\n" @@ -324,7 +325,7 @@ async def test_daily_export_download(async_client, admin_user): mock_client = MagicMock() mock_client.get_object.return_value = mock_response - mock_backend = MagicMock() + mock_backend = MagicMock(spec=MinIOBackend) mock_backend._client = mock_client with patch("api.audit.get_storage_backend", return_value=mock_backend):