"""Settings (plan step 6.14a): a JSON setting must be JSON (a broken one would break the apps that read it: courses, quick notes, the waiter app's table colours); the fiscal folders are plain paths.""" def test_json_settings_are_checked(client, make_user, login): h = login(make_user(role="owner")) assert client.put("/api/settings/orders.courses", headers=h, json={"value": '[{"id":1,"name":"Main","color":"#ef4444"}]'}).status_code == 200 r = client.put("/api/settings/orders.courses", headers=h, json={"value": "[{broken"}) assert r.status_code == 422 and "validation.setting_value" in r.text assert client.put("/api/settings/fiscal.out_folder", headers=h, json={"value": "/mnt/fiscal/in"}).status_code == 200 assert client.put("/api/settings/fiscal.in_folder", headers=h, json={"value": ""}).status_code == 200