refactor(campaigns): remove dead future-start_date scheduling code
Now that only the manager sets start_date, and only at the moment of approval (which immediately activates the campaign), a draft campaign can never have a start_date. This made three things permanently unreachable: the hourly _run_scheduled_campaign_activation cron job, the activate_campaign 409/force future-date guard, and a query filter hiding tests from scheduled-but-inactive draft campaigns. Removes all three rather than leaving dead code behind. Also adds the missing manager-cannot-directly-activate router test.
This commit is contained in:
@@ -279,6 +279,13 @@ def test_admin_can_still_directly_activate_as_override(api, db, red_lead_user, r
|
||||
assert resp.json()["status"] == "active"
|
||||
|
||||
|
||||
def test_manager_cannot_directly_activate_draft_campaign(api, db, red_lead_user, manager_headers):
|
||||
"""A manager approves via /approve — the direct /activate bypass is admin-only."""
|
||||
campaign = _make_draft_campaign(db, red_lead_user.id)
|
||||
resp = api("post", f"/api/v1/campaigns/{campaign.id}/activate", manager_headers)
|
||||
assert resp.status_code == 403
|
||||
|
||||
|
||||
def test_create_campaign_payload_has_no_start_date_field(api, db, red_lead_headers):
|
||||
resp = api(
|
||||
"post",
|
||||
|
||||
Reference in New Issue
Block a user