mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-07 11:53:52 -05:00
update testing
This commit is contained in:
@@ -52,12 +52,14 @@ def get_example_csv_fields(column_headers, use_example_as_example, submitted_fie
|
||||
|
||||
def get_example_csv_rows(template, use_example_as_example=True, submitted_fields=False):
|
||||
return {
|
||||
"email": ["test@example.com"]
|
||||
if use_example_as_example
|
||||
else [current_user.email_address],
|
||||
"sms": ["12223334444"]
|
||||
if use_example_as_example
|
||||
else [current_user.mobile_number],
|
||||
"email": (
|
||||
["test@example.com"]
|
||||
if use_example_as_example
|
||||
else [current_user.email_address]
|
||||
),
|
||||
"sms": (
|
||||
["12223334444"] if use_example_as_example else [current_user.mobile_number]
|
||||
),
|
||||
}[template.template_type] + get_example_csv_fields(
|
||||
(
|
||||
placeholder
|
||||
@@ -511,12 +513,14 @@ def _check_messages(service_id, template_id, upload_id, preview_row):
|
||||
template=template,
|
||||
max_initial_rows_shown=50,
|
||||
max_errors_shown=50,
|
||||
guestlist=itertools.chain.from_iterable(
|
||||
[user.name, user.mobile_number, user.email_address]
|
||||
for user in Users(service_id)
|
||||
)
|
||||
if current_service.trial_mode
|
||||
else None,
|
||||
guestlist=(
|
||||
itertools.chain.from_iterable(
|
||||
[user.name, user.mobile_number, user.email_address]
|
||||
for user in Users(service_id)
|
||||
)
|
||||
if current_service.trial_mode
|
||||
else None
|
||||
),
|
||||
remaining_messages=remaining_messages,
|
||||
allow_international_sms=current_service.has_permission("international_sms"),
|
||||
)
|
||||
@@ -905,13 +909,9 @@ def send_notification(service_id, template_id):
|
||||
|
||||
return redirect(
|
||||
url_for(
|
||||
".view_notification",
|
||||
".view_job",
|
||||
service_id=service_id,
|
||||
from_job=upload_id,
|
||||
notification_id=notifications["notifications"][0]["id"],
|
||||
# used to show the final step of the tour (help=3) or not show
|
||||
# a back link on a just sent one off notification (help=0)
|
||||
help=request.args.get("help"),
|
||||
job_id=upload_id,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -20,19 +20,27 @@
|
||||
{{ page_header(
|
||||
1|message_count_label(template.template_type, suffix='') | capitalize
|
||||
) }}
|
||||
<p>
|
||||
{% if help %}
|
||||
<p>‘{{ template.name }}’</p>
|
||||
‘{{ template.name }}’
|
||||
{% else %}
|
||||
<a class="usa-link" href="{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}">‘{{ template.name }}’</a>
|
||||
{% endif %}
|
||||
<div class="usa-alert usa-alert--success">
|
||||
<div class="usa-alert__body">
|
||||
<h4 class="usa-alert__heading">{{ template.name }} - {{ current_service.name }}</h4>
|
||||
<p class="usa-alert__text">
|
||||
Was sent on {{ created_at|format_datetime_short_12h }} by {{ created_by.name }}
|
||||
was sent
|
||||
{% if job and job.original_file_name != 'Report' %}
|
||||
{% set destination =
|
||||
{'email': 'an email address', 'sms': 'a phone number'} %}
|
||||
to {{ destination[template.template_type] }} from
|
||||
<a class="usa-link" href="{{ url_for('.view_job', service_id=current_service.id, job_id=job.id) }}">{{ job.original_file_name }}</a>
|
||||
{% elif created_by %}
|
||||
by {{ created_by.name }}
|
||||
{% endif %}
|
||||
{{ created_at|format_datetime_human }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ template|string }}
|
||||
<div class="">
|
||||
{{ template|string }}
|
||||
</div>
|
||||
|
||||
{% if template.template_type == 'email' %}
|
||||
<div class="js-stick-at-bottom-when-scrolling">
|
||||
|
||||
@@ -2056,7 +2056,7 @@ def test_create_job_should_call_api(
|
||||
_expected_status=200,
|
||||
)
|
||||
|
||||
assert original_file_name in page.text
|
||||
assert "Message status" in page.text
|
||||
|
||||
mock_create_job.assert_called_with(
|
||||
job_id,
|
||||
|
||||
Reference in New Issue
Block a user