mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Add postage to fixtures and test postage display on notification page
This commit is contained in:
@@ -369,6 +369,7 @@ def notification_json(
|
|||||||
reply_to_text=None,
|
reply_to_text=None,
|
||||||
client_reference=None,
|
client_reference=None,
|
||||||
created_by_name=None,
|
created_by_name=None,
|
||||||
|
postage=None,
|
||||||
):
|
):
|
||||||
if template is None:
|
if template is None:
|
||||||
template = template_json(service_id, str(generate_uuid()), type_=template_type)
|
template = template_json(service_id, str(generate_uuid()), type_=template_type)
|
||||||
@@ -388,6 +389,8 @@ def notification_json(
|
|||||||
if status is None:
|
if status is None:
|
||||||
status = 'delivered'
|
status = 'delivered'
|
||||||
links = {}
|
links = {}
|
||||||
|
if template_type == 'letter':
|
||||||
|
postage = 'second'
|
||||||
|
|
||||||
if with_links:
|
if with_links:
|
||||||
links = {
|
links = {
|
||||||
@@ -415,6 +418,7 @@ def notification_json(
|
|||||||
'service': service_id,
|
'service': service_id,
|
||||||
'template_version': template['version'],
|
'template_version': template['version'],
|
||||||
'personalisation': personalisation or {},
|
'personalisation': personalisation or {},
|
||||||
|
'postage': postage,
|
||||||
'notification_type': template_type,
|
'notification_type': template_type,
|
||||||
'reply_to_text': reply_to_text,
|
'reply_to_text': reply_to_text,
|
||||||
'client_reference': client_reference,
|
'client_reference': client_reference,
|
||||||
|
|||||||
@@ -157,6 +157,9 @@ def test_notification_page_shows_page_for_letter_notification(
|
|||||||
'sample template sent by Test User on 1 January at 1:01am'
|
'sample template sent by Test User on 1 January at 1:01am'
|
||||||
)
|
)
|
||||||
assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == (
|
assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == (
|
||||||
|
'Sent by second class'
|
||||||
|
)
|
||||||
|
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == (
|
||||||
'Estimated delivery date: 6 January'
|
'Estimated delivery date: 6 January'
|
||||||
)
|
)
|
||||||
assert page.select('p.notification-status') == []
|
assert page.select('p.notification-status') == []
|
||||||
|
|||||||
Reference in New Issue
Block a user