mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Merge pull request #938 from GSA/notify-admin-1447
use raw_get and raw_set for better debug of redis
This commit is contained in:
@@ -91,13 +91,15 @@ def _create_service_invite(invited_user, invite_link_host):
|
|||||||
# This is for the login.gov service invite on the
|
# This is for the login.gov service invite on the
|
||||||
# "Set Up Your Profile" path.
|
# "Set Up Your Profile" path.
|
||||||
redis_key = f"service-invite-{invited_user.email_address}"
|
redis_key = f"service-invite-{invited_user.email_address}"
|
||||||
redis_store.set(
|
redis_store.raw_set(
|
||||||
redis_key,
|
redis_key,
|
||||||
json.dumps(data),
|
json.dumps(data),
|
||||||
ex=3600 * 24,
|
ex=3600 * 24,
|
||||||
)
|
)
|
||||||
# TODO REMOVE DEBUG
|
# TODO REMOVE DEBUG
|
||||||
print(hilite(f"Save this data {data} with this redis_key {redis_key}"))
|
print(hilite(f"Save this data {data} with this redis_key {redis_key}"))
|
||||||
|
did_we_save_it = redis_store.raw_get(redis_key)
|
||||||
|
print(hilite(f"Did we save the data successfully? {did_we_save_it}"))
|
||||||
# END DEBUG
|
# END DEBUG
|
||||||
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)
|
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ def test_create_invited_user(
|
|||||||
extra_args,
|
extra_args,
|
||||||
expected_start_of_invite_url,
|
expected_start_of_invite_url,
|
||||||
):
|
):
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_set")
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_get")
|
||||||
|
|
||||||
mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||||
email_address = "invited_user@service.gov.uk"
|
email_address = "invited_user@service.gov.uk"
|
||||||
invite_from = sample_service.users[0]
|
invite_from = sample_service.users[0]
|
||||||
@@ -92,6 +95,9 @@ def test_create_invited_user(
|
|||||||
def test_create_invited_user_without_auth_type(
|
def test_create_invited_user_without_auth_type(
|
||||||
admin_request, sample_service, mocker, invitation_email_template
|
admin_request, sample_service, mocker, invitation_email_template
|
||||||
):
|
):
|
||||||
|
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_set")
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_get")
|
||||||
mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||||
email_address = "invited_user@service.gov.uk"
|
email_address = "invited_user@service.gov.uk"
|
||||||
invite_from = sample_service.users[0]
|
invite_from = sample_service.users[0]
|
||||||
@@ -213,6 +219,9 @@ def test_resend_expired_invite(
|
|||||||
invitation_email_template,
|
invitation_email_template,
|
||||||
mocker,
|
mocker,
|
||||||
):
|
):
|
||||||
|
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_set")
|
||||||
|
mocker.patch("app.service_invite.rest.redis_store.raw_get")
|
||||||
url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}/resend"
|
url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}/resend"
|
||||||
mock_send = mocker.patch("app.service_invite.rest.send_notification_to_queue")
|
mock_send = mocker.patch("app.service_invite.rest.send_notification_to_queue")
|
||||||
mock_persist = mocker.patch("app.service_invite.rest.persist_notification")
|
mock_persist = mocker.patch("app.service_invite.rest.persist_notification")
|
||||||
|
|||||||
Reference in New Issue
Block a user