mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
Indicate template on scheduled jobs
We’ve removed the template on the jobs page, so you can no longer see which template a job is about to be sent with. This is removing information which might enable you to undo a costly mistake. I don’t think we need to bring back the whole template – giving its name, and a link to it meets the need just as well.
This commit is contained in:
@@ -182,7 +182,7 @@ def job_json(
|
||||
if job_id is None:
|
||||
job_id = str(generate_uuid())
|
||||
if template_id is None:
|
||||
template_id = str(generate_uuid())
|
||||
template_id = "5d729fbd-239c-44ab-b498-75a985f3198f"
|
||||
if created_at is None:
|
||||
created_at = str(datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S.%f%z'))
|
||||
data = {
|
||||
|
||||
@@ -8,6 +8,7 @@ from bs4 import BeautifulSoup
|
||||
|
||||
from app.main.views.jobs import get_time_left, get_status_filters
|
||||
from tests import notification_json
|
||||
from tests.app.test_utils import normalize_spaces
|
||||
from tests.conftest import SERVICE_ONE_ID
|
||||
from freezegun import freeze_time
|
||||
|
||||
@@ -161,7 +162,6 @@ def test_should_show_job_in_progress(
|
||||
@freeze_time("2016-01-01T00:00:00.061258")
|
||||
def test_should_show_scheduled_job(
|
||||
logged_in_client,
|
||||
service_one,
|
||||
active_user_with_permissions,
|
||||
mock_get_service_template,
|
||||
mock_get_scheduled_job,
|
||||
@@ -171,13 +171,21 @@ def test_should_show_scheduled_job(
|
||||
):
|
||||
response = logged_in_client.get(url_for(
|
||||
'main.view_job',
|
||||
service_id=service_one['id'],
|
||||
service_id=SERVICE_ONE_ID,
|
||||
job_id=fake_uuid
|
||||
))
|
||||
|
||||
assert response.status_code == 200
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.find('main').find_all('p')[1].text.strip() == 'Sending will start today at midnight'
|
||||
assert normalize_spaces(page.select('main p')[1].text) == (
|
||||
'Sending Two week reminder today at midnight'
|
||||
)
|
||||
assert page.select('main p a')[0]['href'] == url_for(
|
||||
'main.view_template_version',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id='5d729fbd-239c-44ab-b498-75a985f3198f',
|
||||
version=1,
|
||||
)
|
||||
assert page.find('input', {'type': 'submit', 'value': 'Cancel sending'})
|
||||
|
||||
|
||||
@@ -254,6 +262,7 @@ def test_should_show_updates_for_one_job_as_json(
|
||||
service_one,
|
||||
active_user_with_permissions,
|
||||
mock_get_notifications,
|
||||
mock_get_service_template,
|
||||
mock_get_job,
|
||||
mocker,
|
||||
fake_uuid,
|
||||
|
||||
Reference in New Issue
Block a user