Behebe die fehlschlagenden Paperless-Tests und lasse test.yml nur noch nach dem Dev-Deploy laufen.
Deploy Development / deploy (push) Successful in 52s

Der Hinweis zu Tags und Zusatzfeld sitzt wieder in paperless_documents, damit die Signatur von _paperless_get bleibt. Der Push-Trigger entfällt, weil er einen zweiten Lauf auf derselben Testdatenbank startete.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-10-25 07:29:45 +01:00
1 parent 6e1b0916a6
commit bee48bf4a5
4 files changed
+32 -17

No files matched your search

+19 -7
View File
@@ -12,6 +12,7 @@ from email.parser import BytesParser
import pytest
from app.core.errors import unprocessable
from app.media.port import MemoryAdapter
from app.sourceaccess import borrow_original, complete_borrow
from app.sourceregistry import SourceModule, unregister_source, register_source
@@ -593,9 +594,12 @@ def test_paperless_custom_field_filters_use_the_instance_fields(client, db, monk
]
}
if path == "/api/documents/":
if failing:
raise unprocessable(failing[0])
return {"count": 0, "results": []}
return {"results": []}
failing = []
monkeypatch.setattr(sources, "_paperless_get", fake_get)
ada = Actor(client, "ada-custom@example.test", "Ada Custom")
register(db, ada.email, ada.name)
@@ -652,6 +656,21 @@ def test_paperless_custom_field_filters_use_the_instance_fields(client, db, monk
params={"connector_id": first["id"], "custom": "kein json"},
status=422,
)
# Paperless answers 500 for all-tags together with a custom field: the message names that pairing.
failing.append("Paperless hat die Anfrage nicht beantwortet (HTTP 500 auf /api/documents/).")
row = json.dumps([{"field": "2", "op": "exists", "value": True}])
def refused(extra):
return ada.request(
"GET",
"/api/v1/sources/paperless/documents",
params={"connector_id": first["id"], "custom": row, **extra},
status=422,
)
assert "Alle gewählten Tags" in str(refused({"tag": "1,2"}))
assert "Alle gewählten Tags" not in str(refused({"tag": "1,2", "tag_mode": "any"}))
assert "Alle gewählten Tags" not in str(refused({"tag": "1"}))
def test_paperless_refusal_names_the_status_and_reason(monkeypatch):
@@ -677,13 +696,6 @@ def test_paperless_refusal_names_the_status_and_reason(monkeypatch):
with pytest.raises(Problem) as caught:
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {})
assert caught.value.detail.endswith("(HTTP 500 auf /api/documents/).")
with pytest.raises(Problem) as caught:
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {}, "Hinweis.")
assert caught.value.detail.endswith("(HTTP 500 auf /api/documents/). Hinweis.")
monkeypatch.setattr(sources, "urlopen", refuse(400, b"{}"))
with pytest.raises(Problem) as caught:
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {}, "Hinweis.")
assert "Hinweis" not in caught.value.detail
monkeypatch.setattr(sources, "urlopen", refuse(403, b"{}"))
with pytest.raises(Problem) as caught:
sources._paperless_get("https://paper.example.test", "token-alpha", "/api/documents/", {})