mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-15 07:18:09 -04:00
Add an endpoint to cancel a job
If you schedule a job you might change your mind or circumstances might change. So you need to be able to cancel it. This commit adds a `POST` endpoint for individual jobs which sets their status to `cancelled`. This also means adding a new status of `cancelled`, so there’s a migration…
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import requests_mock
|
||||
import pytest
|
||||
import uuid
|
||||
from datetime import (datetime, date)
|
||||
from datetime import (datetime, date, timedelta)
|
||||
|
||||
from flask import current_app
|
||||
|
||||
@@ -288,6 +288,22 @@ def sample_job_with_placeholdered_template(
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_scheduled_job(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=None
|
||||
):
|
||||
return sample_job(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
service=service,
|
||||
template=sample_template_with_placeholders(notify_db, notify_db_session),
|
||||
scheduled_for=(datetime.utcnow() + timedelta(minutes=60)).isoformat(),
|
||||
job_status='scheduled'
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_email_job(notify_db,
|
||||
notify_db_session,
|
||||
|
||||
Reference in New Issue
Block a user