mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
These are basic tests to make sure that the pages stay stitched together. Added for both the jobs and send SMS flows (because the send SMS flow didn’t have any before)
78 lines
2.3 KiB
Python
78 lines
2.3 KiB
Python
from flask import render_template
|
||
|
||
from app.main import main
|
||
|
||
|
||
messages = [
|
||
{
|
||
'phone': '+44 7700 900 579',
|
||
'message': 'Vehicle tax: Your vehicle tax for LV75 TDG expires on 18 January 2016. Renew at www.gov.uk/vehicletax', # noqa
|
||
'status': 'Delivered',
|
||
'time': '13:42',
|
||
'id': '0'
|
||
},
|
||
{
|
||
'phone': '+44 7700 900 306',
|
||
'message': 'Vehicle tax: Your vehicle tax for PL53 GBD expires on 18 January 2016. Renew at www.gov.uk/vehicletax', # noqa
|
||
'status': 'Delivered',
|
||
'time': '13:42',
|
||
'id': '1'
|
||
},
|
||
{
|
||
'phone': '+44 7700 900 454',
|
||
'message': 'Vehicle tax: Your vehicle tax for LV75 TDG expires on 18 January 2016. Renew at www.gov.uk/vehicletax', # noqa
|
||
'status': 'Delivered',
|
||
'time': '13:42',
|
||
'id': '2'
|
||
},
|
||
{
|
||
'phone': '+44 7700 900 522',
|
||
'message': 'Vehicle tax: Your vehicle tax for RE67 PLM expires on 18 January 2016. Renew at www.gov.uk/vehicletax', # noqa
|
||
'status': 'Failed',
|
||
'time': '13:42',
|
||
'id': '3'
|
||
}
|
||
]
|
||
|
||
|
||
@main.route("/jobs")
|
||
def showjobs():
|
||
return render_template('views/jobs.html')
|
||
|
||
|
||
@main.route("/jobs/job")
|
||
def showjob():
|
||
return render_template(
|
||
'views/job.html',
|
||
messages=messages,
|
||
counts={
|
||
'total': len(messages),
|
||
'delivered': len([
|
||
message for message in messages if message['status'] == 'Delivered'
|
||
]),
|
||
'failed': len([
|
||
message for message in messages if message['status'] == 'Failed'
|
||
])
|
||
},
|
||
cost='£0.00',
|
||
uploaded_file_name='contact-demo.csv',
|
||
template_used='Reminder template',
|
||
flash_message='We’ve started sending your notifications'
|
||
)
|
||
|
||
|
||
@main.route("/jobs/job/notification/<string:notification_id>")
|
||
def shownotification(notification_id):
|
||
return render_template(
|
||
'views/notification.html',
|
||
message=[
|
||
message for message in messages if message['id'] == notification_id
|
||
][0],
|
||
history=[
|
||
{'time': '13:42', 'status': 'Delivered'},
|
||
{'time': '13:42', 'status': 'Received by handset'},
|
||
{'time': '13:42', 'status': 'Accepted by network'},
|
||
{'time': '13:41', 'status': 'Sent'},
|
||
]
|
||
)
|