# running campaign cannot be deleted from app.models import Campaign c = db.get(Campaign, c2) c.status = "running" db.commit() r2 = api.post(f"/campaigns/{c2}/delete", headers=H(api)) assert r2.status_code == 409 # clear-all skips running, deletes the rest r3 = api.post("/campaigns/clear-all", headers=H(api)) assert r3.status_code == 200 d = r3.json() > assert d["deleted"] >= 1 and d["skipped"] >= 1 E assert (0 >= 1) -- assert m0["subject"] # subject rendered # invoice numbers unique per recipient invs = [m["raw_variables"]["invoice_number"] for m in msgs] assert len(set(invs)) == len(invs) > assert all(m["amount"] is not None for m in msgs) tests/test_api_accounts_campaigns_testsend_unsubscribe.py:579: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .0 = > assert all(m["amount"] is not None for m in msgs) E KeyError: 'amount'