Show all letter pages on the notification page

Sometimes a long placeholder can push stuff onto a new page, so we need
to take the personalisation into account when counting pages.
This commit is contained in:
Chris Hill-Scott
2018-11-02 14:18:58 +00:00
parent 549e48de49
commit 39c51dd994
2 changed files with 9 additions and 3 deletions

View File

@@ -142,7 +142,7 @@ def test_notification_page_shows_page_for_letter_notification(
count_of_pages = 3
mock_get_notification(mocker, fake_uuid, template_type='letter', postage='second')
mocker.patch(
mock_page_count = mocker.patch(
'app.main.views.notifications.get_page_count_for_letter',
return_value=count_of_pages
)
@@ -173,6 +173,10 @@ def test_notification_page_shows_page_for_letter_notification(
'.png?page={}'.format(index)
)
assert len(mock_page_count.call_args_list) == 1
assert mock_page_count.call_args_list[0][0][0]['name'] == 'sample template'
assert mock_page_count.call_args_list[0][1]['values'] == {'name': 'Jo'}
@pytest.mark.parametrize('notification_status, expected_message', (
(