mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-11 21:01:06 -04:00
Merge pull request #3285 from alphagov/uploads-fix-letter-link
Fix bug where job url type was constructed for letter on uploads page
This commit is contained in:
@@ -52,6 +52,10 @@ class Job(JSONModel):
|
||||
def scheduled_for(self):
|
||||
return self._dict.get('scheduled_for')
|
||||
|
||||
@property
|
||||
def upload_type(self):
|
||||
return self._dict.get('upload_type')
|
||||
|
||||
@property
|
||||
def processing_started(self):
|
||||
if not self._dict.get('processing_started'):
|
||||
|
||||
@@ -42,6 +42,14 @@ def test_get_upload_hub_page(
|
||||
'main.upload_letter', service_id=SERVICE_ONE_ID
|
||||
)
|
||||
|
||||
assert page.findAll(
|
||||
'a', {'class': 'file-list-filename'}
|
||||
)[0].attrs['href'] == '/services/{}/jobs/job_id_1'.format(SERVICE_ONE_ID)
|
||||
|
||||
assert page.findAll(
|
||||
'a', {'class': 'file-list-filename'}
|
||||
)[1].attrs['href'] == '/services/{}/notification/letter_id_1'.format(SERVICE_ONE_ID)
|
||||
|
||||
|
||||
def test_get_upload_letter(client_request):
|
||||
page = client_request.get('main.upload_letter', service_id=SERVICE_ONE_ID)
|
||||
|
||||
@@ -1760,8 +1760,8 @@ def mock_get_uploads(mocker, api_user_active):
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 8, 'status': 'delivered'}, {'count': 2, 'status': 'temporary-failure'}],
|
||||
'upload_type': 'job'},
|
||||
{'id': 'job_id_1',
|
||||
'original_file_name': 'some.csv',
|
||||
{'id': 'letter_id_1',
|
||||
'original_file_name': 'some.pdf',
|
||||
'notification_count': 1,
|
||||
'created_at': '2016-01-01 11:09:00.061258',
|
||||
'statistics': [{'count': 1, 'status': 'delivered'}],
|
||||
|
||||
Reference in New Issue
Block a user