mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -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):
|
def scheduled_for(self):
|
||||||
return self._dict.get('scheduled_for')
|
return self._dict.get('scheduled_for')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def upload_type(self):
|
||||||
|
return self._dict.get('upload_type')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def processing_started(self):
|
def processing_started(self):
|
||||||
if not self._dict.get('processing_started'):
|
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
|
'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):
|
def test_get_upload_letter(client_request):
|
||||||
page = client_request.get('main.upload_letter', service_id=SERVICE_ONE_ID)
|
page = client_request.get('main.upload_letter', service_id=SERVICE_ONE_ID)
|
||||||
|
|||||||
+2
-2
@@ -1760,8 +1760,8 @@ def mock_get_uploads(mocker, api_user_active):
|
|||||||
'created_at': '2016-01-01 11:09:00.061258',
|
'created_at': '2016-01-01 11:09:00.061258',
|
||||||
'statistics': [{'count': 8, 'status': 'delivered'}, {'count': 2, 'status': 'temporary-failure'}],
|
'statistics': [{'count': 8, 'status': 'delivered'}, {'count': 2, 'status': 'temporary-failure'}],
|
||||||
'upload_type': 'job'},
|
'upload_type': 'job'},
|
||||||
{'id': 'job_id_1',
|
{'id': 'letter_id_1',
|
||||||
'original_file_name': 'some.csv',
|
'original_file_name': 'some.pdf',
|
||||||
'notification_count': 1,
|
'notification_count': 1,
|
||||||
'created_at': '2016-01-01 11:09:00.061258',
|
'created_at': '2016-01-01 11:09:00.061258',
|
||||||
'statistics': [{'count': 1, 'status': 'delivered'}],
|
'statistics': [{'count': 1, 'status': 'delivered'}],
|
||||||
|
|||||||
Reference in New Issue
Block a user