From ddb6fd33b077b81d14c8e4c3deade08ee17168d3 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 26 Feb 2020 08:46:02 +0000 Subject: [PATCH 1/2] Fix misnamed test At some point[1] we moved from being able to schedule a job for up to 24 hours to 96 hours. The test was not renamed accordingly. 1. https://github.com/alphagov/notifications-api/pull/711 --- tests/app/job/test_rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/job/test_rest.py b/tests/app/job/test_rest.py index e94cb2076..480b29512 100644 --- a/tests/app/job/test_rest.py +++ b/tests/app/job/test_rest.py @@ -307,7 +307,7 @@ def test_create_job_returns_403_if_letter_template_type_and_service_in_trial( @freeze_time("2016-01-01 11:09:00.061258") -def test_should_not_create_scheduled_job_more_then_24_hours_hence(client, sample_template, mocker, fake_uuid): +def test_should_not_create_scheduled_job_more_then_96_hours_hence(client, sample_template, mocker, fake_uuid): scheduled_date = (datetime.utcnow() + timedelta(hours=96, minutes=1)).isoformat() mocker.patch('app.celery.tasks.process_job.apply_async') mocker.patch('app.job.rest.get_job_metadata_from_s3', return_value={ From a513017f3c554fad126ad9252e5e8099af271e1f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 26 Feb 2020 16:16:20 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Remove=20use=20of=20=E2=80=98hence=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Probably more straightforward language to say ‘in the future’ --- tests/app/job/test_rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/job/test_rest.py b/tests/app/job/test_rest.py index 480b29512..57a7b1957 100644 --- a/tests/app/job/test_rest.py +++ b/tests/app/job/test_rest.py @@ -307,7 +307,7 @@ def test_create_job_returns_403_if_letter_template_type_and_service_in_trial( @freeze_time("2016-01-01 11:09:00.061258") -def test_should_not_create_scheduled_job_more_then_96_hours_hence(client, sample_template, mocker, fake_uuid): +def test_should_not_create_scheduled_job_more_then_96_hours_in_the_future(client, sample_template, mocker, fake_uuid): scheduled_date = (datetime.utcnow() + timedelta(hours=96, minutes=1)).isoformat() mocker.patch('app.celery.tasks.process_job.apply_async') mocker.patch('app.job.rest.get_job_metadata_from_s3', return_value={