Add a component for picking the time to send a job

Users need to pick a time in the next 24hrs, or send a file immediately.

Rationale for this is a bit lost in time-before-holiday, but generally:

‘Now’ and ‘later’ as the inital choices makes it really clear what
this feature is about conceptually.

The choice of times is absolute, eg ‘1pm’ not ‘in 3 hours’
This commit is contained in:
Chris Hill-Scott
2016-08-07 09:17:49 +01:00
parent ee447ba6a4
commit 225a61ddd3
17 changed files with 288 additions and 12 deletions

View File

@@ -27,6 +27,21 @@ def test_client_creates_job_data_correctly(mocker, fake_uuid):
mock_post.assert_called_once_with(url=expected_url, data=expected_data)
def test_client_schedules_job(mocker, fake_uuid):
mocker.patch('app.notify_client.current_user', id='1')
mock_post = mocker.patch('app.notify_client.job_api_client.JobApiClient.post')
when = '2016-08-25T13:04:21.767198'
JobApiClient().create_job(
fake_uuid, fake_uuid, fake_uuid, fake_uuid, 1, scheduled_for=when
)
assert mock_post.call_args[1]['data']['scheduled_for'] == when
def test_client_gets_job_by_service_and_job(mocker):
mocker.patch('app.notify_client.current_user', id='1')