mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 02:48:45 -04:00
Remove existing display of postage
It’s redundant now we’re displaying it as part of the template.
This commit is contained in:
@@ -52,9 +52,6 @@
|
||||
</p>
|
||||
{% else %}
|
||||
{% if sent_with_test_key %}
|
||||
<p>
|
||||
Postage: {{ postage }} class
|
||||
</p>
|
||||
{% if is_precompiled_letter %}
|
||||
<p>
|
||||
This letter passed our checks, but we will not print it because you used a test key.
|
||||
@@ -68,9 +65,6 @@
|
||||
<p>
|
||||
{{ letter_print_day }}
|
||||
</p>
|
||||
<p>
|
||||
Postage: {{ postage }} class
|
||||
</p>
|
||||
<p>
|
||||
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
|
||||
</p>
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="column-whole" id="postage">
|
||||
<h2 class="heading-small heading-inline">Postage</h2>:
|
||||
{{ template_postage or current_service.postage }} class
|
||||
</div>
|
||||
{% else %}
|
||||
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
|
||||
<div class="column-half">
|
||||
|
||||
@@ -170,11 +170,15 @@ def test_notification_page_shows_page_for_letter_notification(
|
||||
'Printing starts today at 5.30pm'
|
||||
)
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == (
|
||||
'Postage: second class'
|
||||
)
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(4)')[0].text) == (
|
||||
'Estimated delivery date: 6 January'
|
||||
)
|
||||
assert len(page.select('.letter-postage')) == 1
|
||||
assert normalize_spaces(page.select_one('.letter-postage').text) == (
|
||||
'Postage: second class'
|
||||
)
|
||||
assert page.select_one('.letter-postage')['class'] == [
|
||||
'letter-postage', 'letter-postage-second'
|
||||
]
|
||||
assert page.select('p.notification-status') == []
|
||||
|
||||
letter_images = page.select('main img')
|
||||
@@ -192,18 +196,18 @@ def test_notification_page_shows_page_for_letter_notification(
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 01:01")
|
||||
@pytest.mark.parametrize('is_precompiled_letter, expected_p1, expected_p2, expected_p3', (
|
||||
@pytest.mark.parametrize('is_precompiled_letter, expected_p1, expected_p2, expected_postage', (
|
||||
(
|
||||
True,
|
||||
'Provided as PDF on 1 January at 1:01am',
|
||||
'Postage: second class',
|
||||
'This letter passed our checks, but we will not print it because you used a test key.',
|
||||
'Postage: second class'
|
||||
),
|
||||
(
|
||||
False,
|
||||
'‘sample template’ was sent on 1 January at 1:01am',
|
||||
'Postage: second class',
|
||||
'We will not print this letter because you used a test key.',
|
||||
'Postage: second class',
|
||||
),
|
||||
))
|
||||
def test_notification_page_shows_page_for_letter_sent_with_test_key(
|
||||
@@ -213,7 +217,7 @@ def test_notification_page_shows_page_for_letter_sent_with_test_key(
|
||||
is_precompiled_letter,
|
||||
expected_p1,
|
||||
expected_p2,
|
||||
expected_p3,
|
||||
expected_postage,
|
||||
):
|
||||
|
||||
mocker.patch(
|
||||
@@ -255,9 +259,9 @@ def test_notification_page_shows_page_for_letter_sent_with_test_key(
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == (
|
||||
expected_p2
|
||||
)
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == (
|
||||
expected_p3
|
||||
)
|
||||
assert normalize_spaces(
|
||||
page.select_one('.letter-postage').text
|
||||
) == expected_postage
|
||||
assert page.select('p.notification-status') == []
|
||||
|
||||
|
||||
@@ -413,8 +417,13 @@ def test_notification_page_shows_page_for_first_class_letter_notification(
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == 'Printing starts tomorrow at 5.30pm'
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == 'Postage: first class'
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(4)')[0].text) == 'Estimated delivery date: 5 January'
|
||||
assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == 'Estimated delivery date: 5 January'
|
||||
assert normalize_spaces(page.select_one('.letter-postage').text) == (
|
||||
'Postage: first class'
|
||||
)
|
||||
assert page.select_one('.letter-postage')['class'] == [
|
||||
'letter-postage', 'letter-postage-first'
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filetype', [
|
||||
|
||||
@@ -456,7 +456,7 @@ def test_view_letter_template_displays_postage(
|
||||
template_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one('#postage').text) == expected_result
|
||||
assert normalize_spaces(page.select_one('.letter-postage').text) == expected_result
|
||||
|
||||
|
||||
def test_view_non_letter_template_does_not_display_postage(
|
||||
|
||||
Reference in New Issue
Block a user