mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 00:41:35 -05:00
Pass through contact block from service to letter
Whatever a user has entered for their service’s contact block should appear in the right place in the file we give to DVLA. The work to output in the right fields in the DVLA file has already been done. We just weren’t passing it through. This commit passes it through.
This commit is contained in:
@@ -274,6 +274,7 @@ def build_dvla_file(self, job_id):
|
|||||||
# This unique id is a 7 digits requested by DVLA, not known
|
# This unique id is a 7 digits requested by DVLA, not known
|
||||||
# if this number needs to be sequential.
|
# if this number needs to be sequential.
|
||||||
numeric_id=random.randint(1, int('9' * 7)),
|
numeric_id=random.randint(1, int('9' * 7)),
|
||||||
|
contact_block=notification.service.letter_contact_block,
|
||||||
))
|
))
|
||||||
for notification in dao_get_all_notifications_for_job(job_id)
|
for notification in dao_get_all_notifications_for_job(job_id)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -994,6 +994,7 @@ def test_build_dvla_file(sample_letter_template, mocker):
|
|||||||
|
|
||||||
# Named arguments
|
# Named arguments
|
||||||
assert mocked_letter_template.call_args[1]['numeric_id'] == 999
|
assert mocked_letter_template.call_args[1]['numeric_id'] == 999
|
||||||
|
assert mocked_letter_template.call_args[1]['contact_block'] == 'London,\nSW1A 1AA'
|
||||||
|
|
||||||
|
|
||||||
def test_build_dvla_file_retries_if_all_notifications_are_not_created(sample_letter_template, mocker):
|
def test_build_dvla_file_retries_if_all_notifications_are_not_created(sample_letter_template, mocker):
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ def sample_service(
|
|||||||
'message_limit': limit,
|
'message_limit': limit,
|
||||||
'restricted': restricted,
|
'restricted': restricted,
|
||||||
'email_from': email_from,
|
'email_from': email_from,
|
||||||
'created_by': user
|
'created_by': user,
|
||||||
|
'letter_contact_block': 'London,\nSW1A 1AA',
|
||||||
}
|
}
|
||||||
service = Service.query.filter_by(name=service_name).first()
|
service = Service.query.filter_by(name=service_name).first()
|
||||||
if not service:
|
if not service:
|
||||||
|
|||||||
Reference in New Issue
Block a user