diff --git a/app/assets/images/icon-important-2x.png b/app/assets/images/icon-important-2x.png new file mode 100644 index 000000000..c04e9c2c9 Binary files /dev/null and b/app/assets/images/icon-important-2x.png differ diff --git a/app/assets/stylesheets/app.scss b/app/assets/stylesheets/app.scss index 3fba6dad2..e88b13ae4 100644 --- a/app/assets/stylesheets/app.scss +++ b/app/assets/stylesheets/app.scss @@ -38,3 +38,11 @@ a:visited { width: 5em; } } + +.column-main { + + > .heading-large { + margin-top: $gutter; + } + +} diff --git a/app/assets/stylesheets/components/banner.scss b/app/assets/stylesheets/components/banner.scss index ae237e56d..8b79307ab 100644 --- a/app/assets/stylesheets/components/banner.scss +++ b/app/assets/stylesheets/components/banner.scss @@ -10,10 +10,12 @@ margin: $gutter-half 0 $gutter 0; text-align: left; position: relative; + clear: both; } -.banner-with-tick { +.banner-with-tick, +.banner-default-with-tick { @extend %banner; padding: $gutter-half ($gutter + $gutter-half); @@ -75,4 +77,19 @@ text-decoration: underline; } + ol { + list-style-type: decimal; + } + +} + +.banner-important { + @extend %banner; + background: $white; + color: $text-colour; + background-image: file-url("icon-important-2x.png"); + background-size: 34px 34px; + background-position: 0 0; + background-repeat: no-repeat; + padding: 7px 0 5px 50px; } diff --git a/app/assets/stylesheets/components/file-upload.scss b/app/assets/stylesheets/components/file-upload.scss index 8f75a8e4c..5750b24d8 100644 --- a/app/assets/stylesheets/components/file-upload.scss +++ b/app/assets/stylesheets/components/file-upload.scss @@ -29,6 +29,7 @@ &-filename { display: inline-block; padding-left: $gutter-half; + @include bold-19; } } diff --git a/app/assets/stylesheets/components/page-footer.scss b/app/assets/stylesheets/components/page-footer.scss index 9b8b2feb1..4aea437c4 100644 --- a/app/assets/stylesheets/components/page-footer.scss +++ b/app/assets/stylesheets/components/page-footer.scss @@ -3,8 +3,10 @@ margin-bottom: 50px; &-back-link { - display: block; - margin-top: $gutter; + @include button($grey-1); + display: inline-block; + padding: 0.52632em 0.78947em 0.26316em 0.78947em; + margin-left: 10px; } &-delete-link { diff --git a/app/assets/stylesheets/components/sms-message.scss b/app/assets/stylesheets/components/sms-message.scss index 268225eac..d019a2b60 100644 --- a/app/assets/stylesheets/components/sms-message.scss +++ b/app/assets/stylesheets/components/sms-message.scss @@ -24,7 +24,7 @@ .sms-message-name { @include bold-19; - margin: 30px 0 10px 0; + margin: 20px 0 10px 0; } .sms-message-picker { @@ -61,3 +61,8 @@ label.sms-message-option { } } + +.sms-message-use-link { + margin-top: 70px; + @include bold-19; +} diff --git a/app/assets/stylesheets/components/table.scss b/app/assets/stylesheets/components/table.scss index f5c0c94b0..97b14296c 100644 --- a/app/assets/stylesheets/components/table.scss +++ b/app/assets/stylesheets/components/table.scss @@ -4,6 +4,7 @@ .table-heading { text-align: left; + margin: 40px 0 5px 0; } %table-field, @@ -56,7 +57,6 @@ .table-empty-message { @include core-16; color: $secondary-text-colour; - border-top: 1px solid $border-colour; border-bottom: 1px solid $border-colour; padding: 0.75em 0 0.5625em 0; } diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 614b7c9c8..f04d61fce 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -1,3 +1,6 @@ +// Path to assets for use with file-url() +$path: '/static/images/'; + // Dependencies from GOV.UK Frontend Toolkit // https://github.com/alphagov/govuk_frontend_toolkit/ @import 'conditionals'; diff --git a/app/main/forms.py b/app/main/forms.py index cd255f029..a5e7f739c 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -217,7 +217,7 @@ class ChangePasswordForm(Form): class CsvUploadForm(Form): - file = FileField('Upload a CSV file to add your recipients’ details', validators=[DataRequired( + file = FileField('Add recipients', validators=[DataRequired( message='Please pick a file'), CsvFileValidator()]) diff --git a/app/main/views/add_service.py b/app/main/views/add_service.py index 27472bbc5..dc7a3a7d4 100644 --- a/app/main/views/add_service.py +++ b/app/main/views/add_service.py @@ -10,8 +10,8 @@ from app.main.forms import AddServiceForm def add_service(): form = AddServiceForm(services_dao.find_all_service_names) services = services_dao.get_services(current_user.id) - if len(services) == 0: - heading = 'Set up notifications for your service' + if len(services['data']) == 0: + heading = 'Which service do you want to set up notifications for?' else: heading = 'Add a new service' if form.validate_on_submit(): diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 9c25fb21f..86acf81c1 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -4,7 +4,7 @@ from app.main import main from app.main.dao.services_dao import get_service_by_id from app.main.dao import templates_dao from client.errors import HTTPError -from ._jobs import jobs +from app import job_api_client @main.route("/services//dashboard") @@ -12,6 +12,7 @@ from ._jobs import jobs def service_dashboard(service_id): try: templates = templates_dao.get_service_templates(service_id)['data'] + jobs = job_api_client.get_job(service_id)['data'] except HTTPError as e: if e.status_code == 404: abort(404) @@ -27,8 +28,8 @@ def service_dashboard(service_id): raise e return render_template( 'views/service_dashboard.html', - jobs=jobs, - free_text_messages_remaining='25,000', + jobs=list(reversed(jobs)), + free_text_messages_remaining='250,000', spent_this_month='0.00', template_count=len(templates), service_id=str(service_id)) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 413bd2491..f18fc4470 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -11,6 +11,7 @@ from client.errors import HTTPError from app import job_api_client from app.main import main +from app.main.dao import templates_dao now = time.strftime('%H:%M') @@ -37,6 +38,7 @@ def view_jobs(service_id): def view_job(service_id, job_id): try: job = job_api_client.get_job(service_id, job_id)['data'] + template = templates_dao.get_service_template(service_id, job['template'])['data'] messages = [] return render_template( 'views/job.html', @@ -53,8 +55,7 @@ def view_job(service_id, job_id): cost=u'£0.00', uploaded_file_name=job['original_file_name'], uploaded_file_time=job['created_at'], - template_used=job['template'], - flash_message="We’ve accepted {} for processing".format(job['original_file_name']), + template=template, service_id=service_id ) except HTTPError as e: diff --git a/app/main/views/sms.py b/app/main/views/sms.py index 3a93e1d55..07aefbff5 100644 --- a/app/main/views/sms.py +++ b/app/main/views/sms.py @@ -32,13 +32,8 @@ from app.main.utils import ( ) -@main.route("/services//sms/send", methods=['GET', 'POST']) +@main.route("/services//sms/send", methods=['GET']) def choose_sms_template(service_id): - if request.method == 'POST': - return redirect(url_for('.send_sms', - service_id=service_id, - template_id=request.form.get('template'))) - try: templates = templates_dao.get_service_templates(service_id)['data'] except HTTPError as e: @@ -103,6 +98,7 @@ def check_sms(service_id, upload_id): 'views/check-sms.html', upload_result=upload_result, message_template=template['content'], + original_file_name=original_file_name, template_id=template_id, service_id=service_id ) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 2cb9176c8..38d175a92 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -3,6 +3,7 @@ from flask_login import login_required from app.main import main from app.main.forms import TemplateForm +from app import job_api_client from app.main.dao.services_dao import get_service_by_id from app.main.dao import templates_dao as tdao from app.main.dao import services_dao as sdao @@ -13,6 +14,7 @@ from client.errors import HTTPError @login_required def manage_service_templates(service_id): try: + jobs = job_api_client.get_job(service_id)['data'] templates = tdao.get_service_templates(service_id)['data'] except HTTPError as e: if e.status_code == 404: @@ -22,6 +24,7 @@ def manage_service_templates(service_id): return render_template( 'views/manage-templates.html', service_id=service_id, + has_jobs=bool(jobs), templates=[tdao.TemplatesBrowsableItem(x) for x in templates]) diff --git a/app/templates/components/file-upload.html b/app/templates/components/file-upload.html index 0c92c0f76..1451b0ee3 100644 --- a/app/templates/components/file-upload.html +++ b/app/templates/components/file-upload.html @@ -1,4 +1,4 @@ -{% macro file_upload(field) %} +{% macro file_upload(field, button_text="Choose file") %}
diff --git a/app/templates/components/table.html b/app/templates/components/table.html index a37a5ef89..ed9b35902 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -25,19 +25,21 @@ {% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True) -%} {% set parent_caller = caller %} - {% if items %} - {% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %} - {% for item in items %} - {% call row() %} - {{ parent_caller(item) }} - {% endcall %} - {% endfor %} - {%- endcall %} - {% else %} -

- {{ empty_message }} -

- {% endif %} + + {% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %} + {% for item in items %} + {% call row() %} + {{ parent_caller(item) }} + {% endcall %} + {% endfor %} + {% if not items %} + {% call row() %} + + {{ empty_message }} + + {% endcall %} + {% endif %} + {%- endcall %} {%- endmacro %} diff --git a/app/templates/flash_messages.html b/app/templates/flash_messages.html index aa775c788..85be2d13d 100644 --- a/app/templates/flash_messages.html +++ b/app/templates/flash_messages.html @@ -4,8 +4,9 @@ {% for category, message in messages %} {{ banner( message, - 'default' if category == 'default' else 'dangerous', - delete_button="Yes, delete this template" if 'delete' == category else None + 'default' if category == 'default' or 'default_with_tick' else 'dangerous', + delete_button="Yes, delete this template" if 'delete' == category else None, + with_tick=True if category == 'default_with_tick' else False )}} {% endfor %} {% endif %} diff --git a/app/templates/views/add-service.html b/app/templates/views/add-service.html index eb1e4af9c..27074cf92 100644 --- a/app/templates/views/add-service.html +++ b/app/templates/views/add-service.html @@ -16,7 +16,8 @@ GOV.UK Notify | Set up service

- Users will see your service name: + Users will see your service name when they receive messages through GOV.UK + Notify:

    @@ -30,7 +31,7 @@ GOV.UK Notify | Set up service
- {{ textbox(form.name) }} + {{ textbox(form.name, hint="You can change this later") }} {{ page_footer('Continue') }}
diff --git a/app/templates/views/check-sms.html b/app/templates/views/check-sms.html index 82c078a46..61950804b 100644 --- a/app/templates/views/check-sms.html +++ b/app/templates/views/check-sms.html @@ -1,6 +1,6 @@ {% extends "withnav_template.html" %} {% from "components/sms-message.html" import sms_message %} -{% from "components/table.html" import table, field %} +{% from "components/table.html" import list_table, field %} {% from "components/placeholder.html" import placeholder %} {% from "components/page-footer.html" import page_footer %} @@ -10,7 +10,7 @@ {% block maincolumn_content %} -

Send text messages

+

Check and confirm

{% if upload_result.rejects %}

The following numbers are invalid

@@ -21,44 +21,29 @@ {% else %} -

Check and confirm

+
+
+ {{ sms_message( + message_template|replace_placeholders(upload_result.valid[0]) + )}} +
+
+
- - {{ page_footer( - button_text = "Send {} text messages".format(upload_result.valid|count), - back_link = url_for(".send_sms", service_id=service_id, template_id=template_id) - )}} - - {% if upload_result.valid | count > 6 %} -

First three message in file

- {% for recipient in upload_result.valid[:3] %} - {{ sms_message(message_template|replace_placeholders( - recipient), - '{}'.format(recipient['phone']) - )}} - {% endfor %} -

Last three messages in file

- {% for recipient in upload_result.valid[-3:] %} - {{ sms_message(message_template|replace_placeholders( - recipient), - '{}'.format(recipient['phone']) - )}} - {% endfor %} - {% else %} -

All messages in file

- {% for recipient in upload_result.valid %} - {{ sms_message(message_template|replace_placeholders( - recipient), - '{}'.format(recipient['phone']) - )}} - {% endfor %} - {% endif %} - - {{ page_footer( - button_text = "Send {} text messages".format(upload_result.valid|count), - back_link = url_for(".send_sms", service_id=service_id, template_id=template_id) - )}} - + + + Back
+ + {% call(item) list_table( + upload_result.valid, + caption=original_file_name, + field_headings=['Phone number'] + ) %} + {% call field() %} + {{ item.phone }} + {% endcall %} + {% endcall %} + {% endif %} {% endblock %} diff --git a/app/templates/views/choose-sms-template.html b/app/templates/views/choose-sms-template.html index 8205df27f..9478c45ab 100644 --- a/app/templates/views/choose-sms-template.html +++ b/app/templates/views/choose-sms-template.html @@ -8,20 +8,24 @@ {% endblock %} {% block maincolumn_content %} + +

Send text messages

+
-

Send text messages

- {% if templates %} -
+
{% for template in templates %} - {{ sms_message( - template.content, name=template.name, input_name='template', input_index=template.id - ) }} +
+ {{ sms_message(template.content, name=template.name) }} +
+ {% endfor %} -
- - {{ page_footer("Continue") }} + {% else %} {{ banner( 'Add a text message template to start sending messages'.format( diff --git a/app/templates/views/documentation.html b/app/templates/views/documentation.html index 3472631a2..924c467ec 100644 --- a/app/templates/views/documentation.html +++ b/app/templates/views/documentation.html @@ -8,13 +8,13 @@ GOV.UK Notify | API keys and documentation {% block maincolumn_content %} +

+ Developer documentation +

+
-

- Developer documentation -

-

How to integrate GOV.UK Notify into your service

diff --git a/app/templates/views/job.html b/app/templates/views/job.html index 15435f040..eda5d8875 100644 --- a/app/templates/views/job.html +++ b/app/templates/views/job.html @@ -2,9 +2,10 @@ {% from "components/table.html" import list_table, field, right_aligned_field_heading %} {% from "components/big-number.html" import big_number %} {% from "components/banner.html" import banner %} +{% from "components/sms-message.html" import sms_message %} {% block page_title %} -GOV.UK Notify | Notifications activity + GOV.UK Notify | Notifications activity {% endblock %} {% block maincolumn_content %} @@ -13,55 +14,66 @@ GOV.UK Notify | Notifications activity {{ uploaded_file_name }} -

- {{ banner(flash_message, with_tick=True) }} +

+
+ {{ sms_message( + template['content'], + )}} +
+
+ +

+ Started {{ uploaded_file_time|format_datetime }}

    -
  • +
  • {{ big_number( - counts.total, - 'text message' if 1 == counts.total else 'text messages' + 1, 'queued' )}}
  • -
  • +
  • + {{ big_number( + 0, 'sent' + )}} +
  • +
  • {{ big_number( counts.failed, - 'failed delivery' if 1 == counts.failed else 'failed deliveries' + 'failed' )}}
  • -
  • +
  • {{ big_number( cost, 'total cost' )}}
-

- Sent with template {{ template_used }} on {{ uploaded_file_time | format_datetime}} -

- {% call(item) list_table( - messages, - caption='Messages', + [ + {'phone': '+447700 900995', 'template': template['name'], 'status': 'queued'} + ], + caption=uploaded_file_name, caption_visible=False, + empty_message="Messages go here", field_headings=[ - 'To', - 'Message', - right_aligned_field_heading('Delivery status') + 'Recipient', + 'Template', + right_aligned_field_heading('Status') ] ) %} {% call field() %} - {{item.phone}} + {{item.phone}} {% endcall %} {% call field() %} - {{item.message[:50]}}… + {{item.template}} {% endcall %} {% call field( align='right', status='error' if item.status == 'Failed' else 'default' ) %} - {{ item.status }} {{ item.time }} + {{ item.status }} {% endcall %} {% endcall %} diff --git a/app/templates/views/manage-templates.html b/app/templates/views/manage-templates.html index 8f8b179ce..a5c1519c9 100644 --- a/app/templates/views/manage-templates.html +++ b/app/templates/views/manage-templates.html @@ -11,13 +11,16 @@ GOV.UK Notify | Manage templates

Templates

- {{ banner( - 'Try sending a text message'.format( - url_for(".choose_sms_template", service_id=service_id) - )|safe, - subhead='Next step', - type="tip" - )}} + + {% if not has_jobs %} + {{ banner( + 'Send yourself a text message'.format( + url_for(".choose_sms_template", service_id=service_id) + )|safe, + subhead='Next step', + type="tip" + )}} + {% endif %}
diff --git a/app/templates/views/send-sms.html b/app/templates/views/send-sms.html index 5ccbec5c1..2f5c62935 100644 --- a/app/templates/views/send-sms.html +++ b/app/templates/views/send-sms.html @@ -8,37 +8,28 @@ {% endblock %} {% block maincolumn_content %} + +

Send text messages

+ -

Send text messages

+
+
+ {{ sms_message(template.content) }} +
+
- {{ banner( - 'You can only send notifications to yourself', - subhead='Trial mode', - type='info' - ) }} - - {{ sms_message( - template.content, name='Preview' - ) }} + {{file_upload(form.file, button_text='Choose a CSV file')}} {{ banner( 'You can only send messages to yourself until you request to go live'.format( url_for('.service_request_to_go_live', service_id=service_id) )|safe, - type='info' + type='important' ) }} - {{file_upload(form.file)}} - -

- Download an example CSV to test with. -

- {{ page_footer( - "Continue", - back_link=url_for(".choose_sms_template", service_id=service_id), - back_link_text="Back to templates" + "Continue to preview" ) }} diff --git a/app/templates/views/service_dashboard.html b/app/templates/views/service_dashboard.html index 7caa0cb66..f2dca758d 100644 --- a/app/templates/views/service_dashboard.html +++ b/app/templates/views/service_dashboard.html @@ -1,5 +1,5 @@ {% extends "withnav_template.html" %} -{% from "components/table.html" import list_table, field %} +{% from "components/table.html" import list_table, field, right_aligned_field_heading %} {% from "components/big-number.html" import big_number %} {% block page_title %} @@ -23,41 +23,38 @@ - {% if not template_count %} + {% if not jobs %} {{ banner( - 'Add a text message template'.format( - url_for(".add_service_template", service_id=service_id) + """ +
    +
  1. + Add a template +
  2. +
  3. + Send yourself a text message +
  4. +
+ """.format( + url_for(".add_service_template", service_id=service_id), + url_for(".choose_sms_template", service_id=service_id) )|safe, subhead='Get started', type="tip" )}} {% else %} - {{ banner( - 'Try sending a text message'.format( - url_for(".choose_sms_template", service_id=service_id) - )|safe, - subhead='Next step', - type="tip" - )}} - {% endif %} - - {% if [] %} {% call(item) list_table( - [], + jobs, caption="Recent text messages", empty_message='You haven’t sent any text messages yet', - field_headings=['Job', 'File', 'Time', 'Status'] + field_headings=['Job', 'Created', right_aligned_field_heading('Status')] ) %} {% call field() %} - {{ item.file }} + {{ item.original_file_name }} {% endcall %} {% call field() %} - {{ item.job }} + {{ item.created_at|format_datetime }} {% endcall %} - {% call field() %} - {{ item.time }} - {% endcall %} - {% call field() %} + {% call field(align='right') %} {{ item.status }} {% endcall %} {% endcall %} diff --git a/app/templates/withnav_template.html b/app/templates/withnav_template.html index 73ce81224..d981762a1 100644 --- a/app/templates/withnav_template.html +++ b/app/templates/withnav_template.html @@ -5,7 +5,7 @@
{% include "main_nav.html" %}
-
+
{% include 'flash_messages.html' %} {% block maincolumn_content %}{% endblock %}
diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index 7a2a3ad67..d5b3386ea 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -7,7 +7,8 @@ def test_should_show_recent_jobs_on_dashboard(app_, mock_get_service_templates, mock_get_user, mock_get_user_by_email, - mock_login): + mock_login, + mock_get_jobs): with app_.test_request_context(): with app_.test_client() as client: diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 6b32dd549..98f99e514 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -27,6 +27,7 @@ def test_should_show_page_for_one_job(app_, mock_login, mock_get_user, mock_get_user_by_email, + mock_get_service_template, job_data, mock_get_job): service_id = job_data['service'] diff --git a/tests/app/main/views/test_sign_out.py b/tests/app/main/views/test_sign_out.py index 03f7edfb1..cf7b5a665 100644 --- a/tests/app/main/views/test_sign_out.py +++ b/tests/app/main/views/test_sign_out.py @@ -18,7 +18,8 @@ def test_sign_out_user(app_, mock_get_user, mock_get_user_by_email, mock_get_service_templates, - mock_login): + mock_login, + mock_get_jobs): with app_.test_request_context(): email = 'valid@example.gov.uk' password = 'val1dPassw0rd!' diff --git a/tests/app/main/views/test_sms.py b/tests/app/main/views/test_sms.py index 274892af1..61b800585 100644 --- a/tests/app/main/views/test_sms.py +++ b/tests/app/main/views/test_sms.py @@ -23,24 +23,6 @@ def test_choose_sms_template(app_, assert 'template two content' in content -def test_choose_sms_template_redirects(app_, - api_user_active, - mock_get_user, - mock_get_service_templates, - mock_check_verify_code, - mock_get_service_template): - with app_.test_request_context(): - with app_.test_client() as client: - client.login(api_user_active) - response = client.post( - url_for('main.choose_sms_template', service_id=12345), - data={'template': '54321'} - ) - - assert response.status_code == 302 - assert response.location == url_for('main.send_sms', service_id=12345, template_id=54321, _external=True) - - def test_upload_empty_csvfile_returns_to_upload_page(app_, api_user_active, mock_get_user, @@ -87,50 +69,13 @@ def test_upload_csvfile_with_invalid_phone_shows_check_page_with_errors(app_, @moto.mock_s3 -def test_upload_csvfile_with_valid_phone_shows_first3_and_last3_numbers(app_, - mocker, - api_user_active, - mock_get_user, - mock_get_user_by_email, - mock_login, - mock_get_service_template): - contents = 'phone\n+44 7700 900981\n+44 7700 900982\n+44 7700 900983\n+44 7700 900984\n+44 7700 900985\n+44 7700 900986\n+44 7700 900987\n+44 7700 900988\n+44 7700 900989' # noqa - - file_data = (BytesIO(contents.encode('utf-8')), 'valid.csv') - - with app_.test_request_context(): - with app_.test_client() as client: - client.login(api_user_active) - upload_data = {'file': file_data} - response = client.post(url_for('main.send_sms', service_id=12345, template_id=54321), - data=upload_data, - follow_redirects=True) - - content = response.get_data(as_text=True) - - assert response.status_code == 200 - assert 'Check and confirm' in content - assert 'First three message in file' in content - assert 'Last three messages in file' in content - assert '+44 7700 900981' in content - assert '+44 7700 900982' in content - assert '+44 7700 900983' in content - assert '+44 7700 900984' not in content - assert '+44 7700 900985' not in content - assert '+44 7700 900986' not in content - assert '+44 7700 900987' in content - assert '+44 7700 900988' in content - assert '+44 7700 900989' in content - - -@moto.mock_s3 -def test_upload_csvfile_with_valid_phone_shows_all_if_6_or_less_numbers(app_, - mocker, - api_user_active, - mock_get_user, - mock_get_user_by_email, - mock_login, - mock_get_service_template): +def test_upload_csvfile_with_valid_phone_shows_all_numbers(app_, + mocker, + api_user_active, + mock_get_user, + mock_get_user_by_email, + mock_login, + mock_get_service_template): contents = 'phone\n+44 7700 900981\n+44 7700 900982\n+44 7700 900983\n+44 7700 900984\n+44 7700 900985\n+44 7700 900986' # noqa @@ -147,8 +92,6 @@ def test_upload_csvfile_with_valid_phone_shows_all_if_6_or_less_numbers(app_, content = response.get_data(as_text=True) assert response.status_code == 200 - assert 'Check and confirm' in content - assert 'All messages in file' in content assert '+44 7700 900981' in content assert '+44 7700 900982' in content assert '+44 7700 900983' in content diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 525c3bcb4..fb2548a65 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -9,7 +9,8 @@ def test_should_return_list_of_all_templates(app_, mock_get_service_templates, mock_get_user, mock_get_user_by_email, - mock_login): + mock_login, + mock_get_jobs): with app_.test_request_context(): with app_.test_client() as client: client.login(api_user_active)