mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-02 12:49:01 -04:00
User can cancel a letter job - happy path
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import json
|
||||
|
||||
import pytest
|
||||
import uuid
|
||||
|
||||
from flask import url_for
|
||||
from freezegun import freeze_time
|
||||
|
||||
@@ -486,6 +488,26 @@ def test_should_not_show_cancelled_job(
|
||||
)
|
||||
|
||||
|
||||
def test_should_cancel_letter_job(
|
||||
client_request,
|
||||
mocker,
|
||||
):
|
||||
job_id = uuid.uuid4()
|
||||
mock_cancel = mocker.patch('app.main.jobs.job_api_client.cancel_letter_job')
|
||||
client_request.post(
|
||||
'main.cancel_letter_job',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
job_id=job_id,
|
||||
_expected_status=302,
|
||||
_expected_redirect=url_for(
|
||||
'main.service_dashboard',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
_external=True,
|
||||
)
|
||||
)
|
||||
mock_cancel.assert_called_once_with(SERVICE_ONE_ID, job_id)
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 00:00:00.000001")
|
||||
def test_should_show_updates_for_one_job_as_json(
|
||||
logged_in_client,
|
||||
|
||||
Reference in New Issue
Block a user