Allow users to preview all letters in trial mode

If you’re in trial mode you can’t send letters for real. But you can
still upload a spreadsheet with multiple rows, and there’s no reason why
you shouldn’t be able to explore how Notify populate the letter for each
row of the spreadsheet (since this is something we let you do when you
can send the messages for real).
This commit is contained in:
Chris Hill-Scott
2018-05-21 10:06:16 +01:00
parent 8ce0c175e8
commit e74d408953
2 changed files with 18 additions and 3 deletions

View File

@@ -2168,7 +2168,8 @@ def test_check_messages_shows_trial_mode_error(
])
@pytest.mark.parametrize('number_of_rows, expected_error_message', [
(1, 'You cant send this letter'),
(111, 'You cant send these letters'),
(11, 'You cant send these letters'), # Less than trial mode limit
(111, 'You cant send these letters'), # More than trial mode limit
])
def test_check_messages_shows_trial_mode_error_for_letters(
client_request,
@@ -2219,6 +2220,9 @@ def test_check_messages_shows_trial_mode_error_for_letters(
else:
assert not error
if number_of_rows > 1:
assert page.select_one('.table-field-index a').text == '3'
def test_check_messages_shows_data_errors_before_trial_mode_errors_for_letters(
mocker,
@@ -2233,6 +2237,7 @@ def test_check_messages_shows_data_errors_before_trial_mode_errors_for_letters(
mocker.patch('app.main.views.send.s3download', return_value='\n'.join(
['address_line_1,address_line_2,postcode,'] +
[' , ,11SW1 1AA'] +
[' , ,11SW1 1AA']
))
@@ -2255,9 +2260,10 @@ def test_check_messages_shows_data_errors_before_trial_mode_errors_for_letters(
assert normalize_spaces(page.select_one('.banner-dangerous').text) == (
'There is a problem with example.xlsx '
'You need to enter missing data in 1 row '
'You need to enter missing data in 2 rows '
'Skip to file contents'
)
assert not page.select('.table-field-index a')
def test_check_messages_column_error_doesnt_show_optional_columns(