from app.security.sanitizer import redact_pii def test_the_published_contact_address_is_kept_and_other_contact_details_are_not() -> None: redacted = redact_pii("Email me@darshanchheda.com or Me@DarshanChheda.com, not dchheda111@gmail.com or +44 7818 975908.") assert redacted.startswith("Email me@darshanchheda.com or Me@DarshanChheda.com, not [REDACTED] or ") assert "gmail" not in redacted assert "7818" not in redacted assert "975908" not in redacted