def METHOD_NAME(document_download):
    with pytest.raises(DocumentDownloadError) as excinfo, requests_mock.Mocker() as request_mock:
        request_mock.post(
            "https://document-download/services/service-id/documents",
            json={"error": "Invalid encoding"},
            status_code=403,
        )
        document_download.upload_document("service-id", {"file": "abababab", "sending_method": "attach"})
    assert excinfo.value.message == "Invalid encoding"
    assert excinfo.value.status_code == 403