Add postage for send-one-off letters.

The postage is set to europe or rest-of-world for international letters, otherwise the template postage is used.

Also set international for letters.
This commit is contained in:
Rebecca Law
2020-07-29 14:52:18 +01:00
parent ed5e73d548
commit 10fe7d9fe8
11 changed files with 216 additions and 66 deletions

View File

@@ -100,6 +100,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_sms(
created_by_id=str(service.created_by_id),
reply_to_text='testing',
reference=None,
postage=None
)
@@ -161,6 +162,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_email(
created_by_id=str(service.created_by_id),
reply_to_text=None,
reference=None,
postage=None
)
@@ -188,8 +190,8 @@ def test_send_one_off_notification_calls_persist_correctly_for_letter(
'to': 'First Last',
'personalisation': {
'name': 'foo',
'address line 1': 'First Last',
'address line 2': '1 Example Street',
'address_line_1': 'First Last',
'address_line_2': '1 Example Street',
'postcode': 'SW1A 1AA',
},
'created_by': str(service.created_by_id)
@@ -210,6 +212,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_letter(
created_by_id=str(service.created_by_id),
reply_to_text=None,
reference='this-is-random-in-real-life',
postage=None
)
@@ -362,6 +365,12 @@ def test_send_one_off_letter_notification_should_use_template_reply_to_text(samp
data = {
'to': 'user@example.com',
'template_id': str(sample_letter_template.id),
'personalisation': {
'name': 'foo',
'address_line_1': 'First Last',
'address_line_2': '1 Example Street',
'address_line_3': 'SW1A 1AA',
},
'created_by': str(sample_letter_template.service.created_by_id)
}
@@ -383,6 +392,12 @@ def test_send_one_off_letter_should_not_make_pdf_in_research_mode(sample_letter_
data = {
'to': 'A. Name',
'template_id': str(sample_letter_template.id),
'personalisation': {
'name': 'foo',
'address_line_1': 'First Last',
'address_line_2': '1 Example Street',
'address_line_3': 'SW1A 1AA',
},
'created_by': str(sample_letter_template.service.created_by_id)
}