Merge branch 'main' of https://github.com/GSA/notifications-admin into 1544-data-viz-total-message-allowance

This commit is contained in:
Jonathan Bobel
2024-06-10 10:02:24 -04:00
8 changed files with 109 additions and 32 deletions

View File

@@ -179,26 +179,6 @@ def test_old_static_pages_redirect(client_request, view, expected_view):
)
def test_message_status_page_contains_message_status_ids(client_request):
# The 'email-statuses' and 'sms-statuses' id are linked to when we display a message status,
# so this test ensures we don't accidentally remove them
page = client_request.get("main.message_status")
# email-statuses is commented out in view
# assert page.find(id='email-statuses')
assert page.find(id="text-message-statuses")
def test_message_status_page_contains_link_to_support(client_request):
page = client_request.get("main.message_status")
sms_status_table = page.find(id="text-message-statuses").findNext("tbody")
temp_fail_details_cell = sms_status_table.select_one(
"tr:nth-child(4) > td:nth-child(2)"
)
assert temp_fail_details_cell.find("a").attrs["href"] == url_for("main.support")
def test_old_using_notify_page(client_request):
client_request.get("main.using_notify", _expected_status=410)

View File

@@ -49,3 +49,13 @@ def test_base_json_formatter_contains_service_id():
== "message to log"
)
assert service_id_filter.filter(record).service_id == "no-service-id"
def test_scrub():
result = logging.scrub(
"This is a message with 17775554324, and also 18884449323 and also 17775554324"
)
assert (
result
== "This is a message with 1XXXXX54324, and also 1XXXXX49323 and also 1XXXXX54324"
)