Show message on job page if job is scheduled

If a job is scheduled then we can’t show the notifications yet, and the
progress report will stay at 0%.

In their place we should show what time a job will start.

Later on (when the API is ready) this area of the page should also show
a cancel button.
This commit is contained in:
Chris Hill-Scott
2016-08-25 16:49:31 +01:00
parent 4342b721f1
commit 31a032e678
4 changed files with 103 additions and 56 deletions

View File

@@ -126,6 +126,29 @@ def test_should_show_job_in_progress(
assert page.find('p', {'class': 'hint'}).text.strip() == 'Report is 50% complete…'
def test_should_show_scheduled_job(
app_,
service_one,
active_user_with_permissions,
mock_get_service_template,
mock_get_scheduled_job,
mocker,
mock_get_notifications,
fake_uuid
):
with app_.test_request_context(), app_.test_client() as client:
client.login(active_user_with_permissions, mocker, service_one)
response = client.get(url_for(
'main.view_job',
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')[2].text.strip() == 'Sending will start at midnight'
def test_should_show_not_show_csv_download_in_tour(
app_,
service_one,