Wait only 5 seconds for CWA on the story page

A job still waits for the full timeout.
This commit is contained in:
tim
2026-10-02 23:37:33 +02:00
parent e196d1688e
commit 90457610f6
4 changed files with 21 additions and 5 deletions
+1
View File
@@ -99,6 +99,7 @@ def test_library_search_link_import_and_unlink(client, story, monkeypatch):
assert client.get("/api/library/search?q=Title").json[0]["tracked_as"] == "Story"
cwa.get_book.side_effect = CwaError("offline")
assert client.get(f"/api/stories/{sid}").json["library_error"] == "offline"
cwa.get_book.assert_called_with("book-7", timeout=5) # the page does not wait long for CWA
cwa.get_book.side_effect = None
cwa.get_book.return_value = None
assert client.post(f"/api/stories/{sid}/link", json={"uuid": "missing"}, headers=H).status_code == 404