Simplify the upload state and the story page data
The pause of the user and a missing ingest folder are separate checks. One function gives the upload state to the settings and the story page. A route that returns only a story no longer loads its chapters or asks CWA for its book. The story page data loses the values that no page reads.
This commit is contained in:
@@ -187,3 +187,15 @@ def test_chapter_requests_without_ids_name_what_to_select(client, story):
|
||||
for body in ({}, {"chapter_ids": None}):
|
||||
response = client.post(f"/api/stories/{sid}/chapters/delete", json=body, headers=H)
|
||||
assert (response.status_code, response.json["error"]) == (400, "Select the chapters to delete")
|
||||
|
||||
|
||||
def test_a_story_change_does_not_ask_cwa_for_the_book(client, story, monkeypatch):
|
||||
sid, _ = story
|
||||
o.store.update_story(sid, calibre_id=7, calibre_uuid="book-7")
|
||||
monkeypatch.setattr(config, "CWA_URL", "https://cwa.example")
|
||||
cwa = Mock()
|
||||
monkeypatch.setattr(o, "cwa", lambda: cwa)
|
||||
response = client.put(f"/api/stories/{sid}/settings", json={"recheck_days": 4}, headers=H)
|
||||
assert response.json["recheck_days"] == 4
|
||||
assert "chapters" not in response.json
|
||||
cwa.get_book.assert_not_called()
|
||||
|
||||
Reference in New Issue
Block a user