mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-28 11:49:13 -04:00
Merge branch 'main' of https://github.com/GSA/notifications-admin into 1484-dashboard-visualizations
This commit is contained in:
@@ -228,12 +228,18 @@ def test_can_show_notifications_if_data_retention_not_available(
|
||||
url_for,
|
||||
".download_notifications_csv",
|
||||
message_type=None,
|
||||
number_of_days="seven_day",
|
||||
),
|
||||
),
|
||||
(
|
||||
create_active_user_with_permissions(),
|
||||
{"status": "failed"},
|
||||
partial(url_for, ".download_notifications_csv", status="failed"),
|
||||
partial(
|
||||
url_for,
|
||||
".download_notifications_csv",
|
||||
status="failed",
|
||||
number_of_days="seven_day",
|
||||
),
|
||||
),
|
||||
(
|
||||
create_active_user_with_permissions(),
|
||||
@@ -242,15 +248,13 @@ def test_can_show_notifications_if_data_retention_not_available(
|
||||
url_for,
|
||||
".download_notifications_csv",
|
||||
message_type="sms",
|
||||
number_of_days="seven_day",
|
||||
),
|
||||
),
|
||||
(
|
||||
create_active_user_view_permissions(),
|
||||
{},
|
||||
partial(
|
||||
url_for,
|
||||
".download_notifications_csv",
|
||||
),
|
||||
partial(url_for, ".download_notifications_csv", number_of_days="seven_day"),
|
||||
),
|
||||
(
|
||||
create_active_caseworking_user(),
|
||||
|
||||
@@ -51,11 +51,16 @@ def test_base_json_formatter_contains_service_id():
|
||||
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"
|
||||
def test_pii_filter():
|
||||
record = builtin_logging.LogRecord(
|
||||
name="log thing",
|
||||
level="info",
|
||||
pathname="path",
|
||||
lineno=123,
|
||||
msg="phone1: 1555555555, phone2: 1555555554, email1: fake@fake.gov, email2: fake@fake2.fake.gov",
|
||||
exc_info=None,
|
||||
args=None,
|
||||
)
|
||||
pii_filter = logging.PIIFilter()
|
||||
clean_msg = "phone1: 1XXXXXXXXXX, phone2: 1XXXXXXXXXX, email1: XXXXX@XXXXXXX, email2: XXXXX@XXXXXXX"
|
||||
assert pii_filter.filter(record).msg == clean_msg
|
||||
|
||||
Reference in New Issue
Block a user