mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Increase number of rows shown
We probably shouldn’t hide the contents of the CSV when people are just testing the app, or if they’re starting off with small jobs. A limit of 15 rows displayed was awkwardly on the cusp between just testing and sending a small batch. This commit increases the limit to 50; I reckon that over 50 recipients no-one will be wanting to check them all individually.
This commit is contained in:
@@ -227,8 +227,8 @@ def check_messages(service_id, template_type, upload_id):
|
|||||||
contents,
|
contents,
|
||||||
template_type=template.template_type,
|
template_type=template.template_type,
|
||||||
placeholders=template.placeholders,
|
placeholders=template.placeholders,
|
||||||
max_initial_rows_shown=15,
|
max_initial_rows_shown=50,
|
||||||
max_errors_shown=15,
|
max_errors_shown=50,
|
||||||
whitelist=itertools.chain.from_iterable(
|
whitelist=itertools.chain.from_iterable(
|
||||||
[user.mobile_number, user.email_address] for user in users
|
[user.mobile_number, user.email_address] for user in users
|
||||||
) if current_service['restricted'] else None
|
) if current_service['restricted'] else None
|
||||||
|
|||||||
@@ -157,27 +157,9 @@ def test_upload_csvfile_with_valid_phone_shows_all_numbers(
|
|||||||
|
|
||||||
mocker.patch(
|
mocker.patch(
|
||||||
'app.main.views.send.s3download',
|
'app.main.views.send.s3download',
|
||||||
return_value="""
|
return_value='\n'.join(['phone number'] + [
|
||||||
phone number
|
'07700 9007{0:02d}'.format(final_two) for final_two in range(0, 53)
|
||||||
07700 900701
|
])
|
||||||
07700 900702
|
|
||||||
07700 900703
|
|
||||||
07700 900704
|
|
||||||
07700 900705
|
|
||||||
07700 900706
|
|
||||||
07700 900707
|
|
||||||
07700 900708
|
|
||||||
07700 900709
|
|
||||||
07700 900710
|
|
||||||
07700 900711
|
|
||||||
07700 900712
|
|
||||||
07700 900713
|
|
||||||
07700 900714
|
|
||||||
07700 900715
|
|
||||||
07700 900799
|
|
||||||
07700 900799
|
|
||||||
07700 900799
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
with app_.test_request_context():
|
with app_.test_request_context():
|
||||||
@@ -192,14 +174,14 @@ def test_upload_csvfile_with_valid_phone_shows_all_numbers(
|
|||||||
with client.session_transaction() as sess:
|
with client.session_transaction() as sess:
|
||||||
assert int(sess['upload_data']['template_id']) == 54321
|
assert int(sess['upload_data']['template_id']) == 54321
|
||||||
assert sess['upload_data']['original_file_name'] == 'valid.csv'
|
assert sess['upload_data']['original_file_name'] == 'valid.csv'
|
||||||
assert sess['upload_data']['notification_count'] == 18
|
assert sess['upload_data']['notification_count'] == 53
|
||||||
|
|
||||||
content = response.get_data(as_text=True)
|
content = response.get_data(as_text=True)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert '07700 900701' in content
|
assert '07700 900701' in content
|
||||||
assert '07700 900715' in content
|
assert '07700 900749' in content
|
||||||
assert '07700 900716' not in content
|
assert '07700 900750' not in content
|
||||||
assert '3 rows not shown' in content
|
assert 'Only showing the first 50 rows with errors' in content
|
||||||
|
|
||||||
|
|
||||||
def test_create_job_should_call_api(
|
def test_create_job_should_call_api(
|
||||||
|
|||||||
Reference in New Issue
Block a user