test: assert omitted attach_to_session stays absent from formatted list output

Closes the gap flagged in review: the raw store was checked but not the
_format_job surface.
This commit is contained in:
kshitijk4poor
2026-08-26 14:19:59 +05:30
committed by kshitij
parent 5e9adc9e4d
commit 365cbc242b

View File

@@ -553,6 +553,12 @@ class TestRegisteredHandlerForwardsAttachToSession:
stored = get_job(created["job_id"]) stored = get_job(created["job_id"])
assert stored is not None assert stored is not None
assert "attach_to_session" not in stored assert "attach_to_session" not in stored
# And the formatted list output must not invent the field either.
listed = json.loads(registry.dispatch("cronjob", {"action": "list"}))
formatted = next(
j for j in listed["jobs"] if j["job_id"] == created["job_id"]
)
assert "attach_to_session" not in formatted
class TestLocalDeliveryNotice: class TestLocalDeliveryNotice: