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

@@ -541,3 +541,23 @@ def test_persist_notification_with_billable_units_stores_correct_info(
persisted_notification = Notification.query.all()[0]
assert persisted_notification.billable_units == 3
@pytest.mark.parametrize('postage', ['europe', 'rest-of-world'])
def test_persist_notification_for_international_letter(sample_letter_template, postage):
notification = persist_notification(
template_id=sample_letter_template.id,
template_version=sample_letter_template.version,
recipient="123 Main Street",
service=sample_letter_template.service,
personalisation=None,
notification_type=sample_letter_template.template_type,
api_key_id=None,
key_type="normal",
billable_units=3,
postage=postage,
template_postage='second'
)
persisted_notification = Notification.query.get(notification.id)
assert persisted_notification.postage == postage
assert persisted_notification.international