mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
Merge pull request #3264 from alphagov/account-for-missing-scheduled_for
Account for missing scheduled for field
This commit is contained in:
@@ -26,7 +26,6 @@ class Job(JSONModel):
|
||||
'notification_count',
|
||||
'job_status',
|
||||
'created_by',
|
||||
'scheduled_for',
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -45,6 +44,10 @@ class Job(JSONModel):
|
||||
def scheduled(self):
|
||||
return self.status == 'scheduled'
|
||||
|
||||
@property
|
||||
def scheduled_for(self):
|
||||
return self._dict.get('scheduled_for')
|
||||
|
||||
def _aggregate_statistics(self, *statuses):
|
||||
return sum(
|
||||
outcome['count'] for outcome in self._dict['statistics']
|
||||
|
||||
@@ -1732,7 +1732,6 @@ def mock_get_uploads(mocker, api_user_active):
|
||||
'notification_count': 10,
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 8, 'status': 'delivered'}, {'count': 2, 'status': 'temporary-failure'}],
|
||||
'scheduled_for': None,
|
||||
'job_status': 'finished',
|
||||
'upload_type': 'job'},
|
||||
{'id': 'job_id_1',
|
||||
@@ -1740,7 +1739,6 @@ def mock_get_uploads(mocker, api_user_active):
|
||||
'notification_count': 1,
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 1, 'status': 'delivered'}],
|
||||
'scheduled_for': None,
|
||||
'job_status': 'finished',
|
||||
'upload_type': 'letter'}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user