Merge pull request #3660 from alphagov/fix-incorrect-processing-started-time-jobs

Fix incorrect processing started time on jobs
This commit is contained in:
Chris Hill-Scott
2020-10-06 12:00:30 +01:00
committed by GitHub
5 changed files with 22 additions and 22 deletions

View File

@@ -690,8 +690,8 @@ def test_should_show_updates_for_scheduled_job_as_json(
service_one['id'],
created_by=user_json(),
job_id=fake_uuid,
scheduled_for='2016-06-01T13:00:00',
processing_started='2016-06-01T15:00:00',
scheduled_for='2016-06-01T13:00:00+00:00',
processing_started='2016-06-01T15:00:00+00:00',
)})
response = logged_in_client.get(url_for('main.view_job_updates', service_id=service_one['id'], job_id=fake_uuid))
@@ -706,7 +706,7 @@ def test_should_show_updates_for_scheduled_job_as_json(
assert 'Status' in content['notifications']
assert 'Delivered' in content['notifications']
assert '12:01am' in content['notifications']
assert 'Sent by Test User on 1 June at 5:00pm' in content['status']
assert 'Sent by Test User on 1 June at 4:00pm' in content['status']
@pytest.mark.parametrize(

View File

@@ -20,7 +20,7 @@ from app.utils import (
get_letter_validation_error,
get_logo_cdn_domain,
get_sample_template,
is_less_than_90_days_ago,
is_less_than_days_ago,
merge_jsonlike,
printing_today_or_tomorrow,
round_to_significant_figures,
@@ -597,10 +597,11 @@ def test_get_letter_validation_error_for_known_errors(
@pytest.mark.parametrize("date_from_db, expected_result", [
('2019-11-17T11:35:21.726132Z', True),
('2019-11-16T11:35:21.726132Z', False),
('2019-11-16T11:35:21+0000', False),
])
@freeze_time('2020-02-14T12:00:00')
def test_is_less_than_90_days_ago(date_from_db, expected_result):
assert is_less_than_90_days_ago(date_from_db) == expected_result
def test_is_less_than_days_ago(date_from_db, expected_result):
assert is_less_than_days_ago(date_from_db, 90) == expected_result
@pytest.mark.parametrize("template_type", ["sms", "letter", "email"])