If template has a default address use that address ELSE the address is blank.

This commit is contained in:
Rebecca Law
2018-01-08 15:54:58 +00:00
parent 06197478e1
commit d6683d9630
4 changed files with 24 additions and 13 deletions

View File

@@ -993,8 +993,8 @@ def test_save_sms_does_not_send_duplicate_and_does_not_put_in_retry_queue(sample
def test_save_letter_saves_letter_to_database(mocker, notify_db_session):
service = create_service()
create_letter_contact(service=service, contact_block="Address contact", is_default=True)
template = create_template(service=service, template_type=LETTER_TYPE)
contact_block = create_letter_contact(service=service, contact_block="Address contact", is_default=True)
template = create_template(service=service, template_type=LETTER_TYPE, reply_to=contact_block.id)
job = create_job(template=template)
mocker.patch('app.celery.tasks.create_random_identifier', return_value="this-is-random-in-real-life")
@@ -1037,7 +1037,7 @@ def test_save_letter_saves_letter_to_database(mocker, notify_db_session):
assert notification_db.sent_by is None
assert notification_db.personalisation == personalisation
assert notification_db.reference == "this-is-random-in-real-life"
assert notification_db.reply_to_text == "Address contact"
assert notification_db.reply_to_text == contact_block.contact_block
def test_save_letter_uses_template_reply_to_text(mocker, notify_db_session):