Limit and configure how many jobs the Jobs panels show
This commit is contained in:
@@ -289,6 +289,10 @@ def test_settings(client, monkeypatch, tmp_path):
|
||||
"hold_new_links": False,
|
||||
"pause_uploads": False,
|
||||
"personal_ini": "[defaults]\nis_adult:true\n",
|
||||
"story_jobs_hours": 36,
|
||||
"story_jobs_count": 10,
|
||||
"main_jobs_hours": 6,
|
||||
"main_jobs_count": 25,
|
||||
}
|
||||
saved = client.put("/api/settings", json={"recent_chapters": 3}, headers=H).json
|
||||
assert (saved["recent_chapters"], saved["warnings"]) == (3, [])
|
||||
@@ -301,6 +305,16 @@ def test_settings(client, monkeypatch, tmp_path):
|
||||
assert bad.status_code == 400 and "line 1" in bad.json["error"]
|
||||
assert ini.read_text() == "[www.notasite.com]\nx:1\n"
|
||||
assert client.put("/api/settings", json={"recent_chapters": -1}, headers=H).status_code == 400
|
||||
saved = client.put(
|
||||
"/api/settings",
|
||||
json={"story_jobs_hours": 48, "story_jobs_count": 20, "main_jobs_hours": 12, "main_jobs_count": 50},
|
||||
headers=H,
|
||||
).json
|
||||
assert (saved["story_jobs_hours"], saved["story_jobs_count"]) == (48, 20)
|
||||
assert (saved["main_jobs_hours"], saved["main_jobs_count"]) == (12, 50)
|
||||
assert client.put("/api/settings", json={"story_jobs_hours": -1}, headers=H).status_code == 400
|
||||
assert client.put("/api/settings", json={"story_jobs_hours": 721}, headers=H).status_code == 400
|
||||
assert client.put("/api/settings", json={"main_jobs_count": 501}, headers=H).status_code == 400
|
||||
|
||||
|
||||
def test_metadata_edit(client):
|
||||
|
||||
Reference in New Issue
Block a user