mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
merge from main
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -201,10 +201,10 @@ def test_send_user_sms_code(client, sample_user, sms_code_template, mocker):
|
||||
"""
|
||||
notify_service = dao_fetch_service_by_id(current_app.config["NOTIFY_SERVICE_ID"])
|
||||
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.raw_get")
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.get")
|
||||
mock_redis_get.return_value = "foo"
|
||||
|
||||
mocker.patch("app.user.rest.redis_store.raw_set")
|
||||
mocker.patch("app.user.rest.redis_store.set")
|
||||
auth_header = create_admin_authorization_header()
|
||||
mocked = mocker.patch("app.user.rest.create_secret_code", return_value="11111")
|
||||
mocker.patch("app.celery.provider_tasks.deliver_sms.apply_async")
|
||||
@@ -242,10 +242,10 @@ def test_send_user_code_for_sms_with_optional_to_field(
|
||||
Tests POST endpoint /user/<user_id>/sms-code with optional to field
|
||||
"""
|
||||
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.raw_get")
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.get")
|
||||
mock_redis_get.return_value = "foo"
|
||||
|
||||
mocker.patch("app.user.rest.redis_store.raw_set")
|
||||
mocker.patch("app.user.rest.redis_store.set")
|
||||
to_number = "+14254147755"
|
||||
mocked = mocker.patch("app.user.rest.create_secret_code", return_value="11111")
|
||||
mocker.patch("app.celery.provider_tasks.deliver_sms.apply_async")
|
||||
@@ -469,10 +469,10 @@ def test_send_user_email_code(
|
||||
deliver_email = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
sample_user.auth_type = auth_type
|
||||
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.raw_get")
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.get")
|
||||
mock_redis_get.return_value = "foo"
|
||||
|
||||
mocker.patch("app.user.rest.redis_store.raw_set")
|
||||
mocker.patch("app.user.rest.redis_store.set")
|
||||
|
||||
admin_request.post(
|
||||
"user.send_user_2fa_code",
|
||||
@@ -497,10 +497,10 @@ def test_send_user_email_code_with_urlencoded_next_param(
|
||||
):
|
||||
mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
|
||||
mock_redis_get = mocker.patch("app.celery.scheduled_tasks.redis_store.raw_get")
|
||||
mock_redis_get = mocker.patch("app.celery.scheduled_tasks.redis_store.get")
|
||||
mock_redis_get.return_value = "foo"
|
||||
|
||||
mocker.patch("app.celery.scheduled_tasks.redis_store.raw_set")
|
||||
mocker.patch("app.celery.scheduled_tasks.redis_store.set")
|
||||
|
||||
data = {"to": None, "next": "/services"}
|
||||
admin_request.post(
|
||||
@@ -581,10 +581,10 @@ def test_user_verify_email_code_fails_if_code_already_used(
|
||||
def test_send_user_2fa_code_sends_from_number_for_international_numbers(
|
||||
client, sample_user, mocker, sms_code_template
|
||||
):
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.raw_get")
|
||||
mock_redis_get = mocker.patch("app.user.rest.redis_store.get")
|
||||
mock_redis_get.return_value = "foo"
|
||||
|
||||
mocker.patch("app.user.rest.redis_store.raw_set")
|
||||
mocker.patch("app.user.rest.redis_store.set")
|
||||
|
||||
sample_user.mobile_number = "+601117224412"
|
||||
auth_header = create_admin_authorization_header()
|
||||
|
||||
Reference in New Issue
Block a user