mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
This commit adds two things: a section on the dashboard to show how many inbound messages the service has received in the last 7 days, and how recently an inbound message has been received --- Doesn’t show the contents of any messages, just like how the rest of the dashboard is an aggregation, never individual messages. a page to show all the inbound messages the service has received in the last 7 days --- This shows the first line of the message. Eventually this will link through to a ‘conversation’ page, where a service can see all the messages it’s received from a given phone number.
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
from flask import url_for
|
|
|
|
|
|
def test_render_sign_out_redirects_to_sign_in(
|
|
client
|
|
):
|
|
response = client.get(
|
|
url_for('main.sign_out'))
|
|
assert response.status_code == 302
|
|
assert response.location == url_for(
|
|
'main.index', _external=True)
|
|
|
|
|
|
def test_sign_out_user(
|
|
logged_in_client,
|
|
mock_get_service,
|
|
api_user_active,
|
|
mock_get_user,
|
|
mock_get_user_by_email,
|
|
mock_login,
|
|
mock_get_service_templates,
|
|
mock_get_jobs,
|
|
mock_has_permissions,
|
|
mock_get_template_statistics,
|
|
mock_get_detailed_service,
|
|
mock_get_usage,
|
|
mock_get_inbound_sms_summary,
|
|
):
|
|
with logged_in_client.session_transaction() as session:
|
|
assert session.get('user_id') is not None
|
|
# Check we are logged in
|
|
response = logged_in_client.get(
|
|
url_for('main.service_dashboard', service_id="123"))
|
|
assert response.status_code == 200
|
|
response = logged_in_client.get(url_for('main.sign_out'))
|
|
assert response.status_code == 302
|
|
assert response.location == url_for(
|
|
'main.index', _external=True)
|
|
with logged_in_client.session_transaction() as session:
|
|
assert session.get('user_id') is None
|