mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 16:23:44 -04:00
add more debug and add command to download csv files
This commit is contained in:
@@ -79,7 +79,7 @@ def test_should_reject_bad_phone_numbers(notify_api, sample_template, mocker):
|
||||
assert json_resp["result"] == "error"
|
||||
assert len(json_resp["message"].keys()) == 1
|
||||
assert (
|
||||
"Invalid phone number: The string supplied did not seem to be a phone number."
|
||||
"Invalid phone number: Invalid phone number looks like invalid The string supplied did not seem to be a phone number." # noqa
|
||||
in json_resp["message"]["to"]
|
||||
)
|
||||
assert response.status_code == 400
|
||||
|
||||
@@ -226,7 +226,7 @@ def test_cannot_create_user_with_empty_strings(admin_request, notify_db_session)
|
||||
assert resp["message"] == {
|
||||
"email_address": ["Not a valid email address"],
|
||||
"mobile_number": [
|
||||
"Invalid phone number: The string supplied did not seem to be a phone number."
|
||||
"Invalid phone number: Invalid phone number looks like The string supplied did not seem to be a phone number." # noqa
|
||||
],
|
||||
"name": ["Invalid name"],
|
||||
}
|
||||
@@ -949,7 +949,7 @@ def test_cannot_update_user_with_mobile_number_as_empty_string(
|
||||
_expected_status=400,
|
||||
)
|
||||
assert resp["message"]["mobile_number"] == [
|
||||
"Invalid phone number: The string supplied did not seem to be a phone number."
|
||||
"Invalid phone number: Invalid phone number looks like The string supplied did not seem to be a phone number." # noqa
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ from notifications_utils.recipients import (
|
||||
get_international_phone_info,
|
||||
international_phone_info,
|
||||
is_us_phone_number,
|
||||
show_mangled_number_clues,
|
||||
try_validate_and_format_phone_number,
|
||||
validate_and_format_phone_number,
|
||||
validate_email_address,
|
||||
@@ -324,6 +325,11 @@ def test_phone_number_rejects_invalid_international_values(phone_number, error_m
|
||||
assert error_message == str(e.value)
|
||||
|
||||
|
||||
def test_show_mangled_number_clues():
|
||||
x = show_mangled_number_clues("848!!-202?-2020$$")
|
||||
assert x == "XXX!!-XXX?-XXXX$$"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("email_address", valid_email_addresses)
|
||||
def test_validate_email_address_accepts_valid(email_address):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user