mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
add expire times for redis objects
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
from unittest.mock import ANY
|
||||
|
||||
import pytest
|
||||
from botocore.exceptions import ClientError
|
||||
@@ -148,7 +149,7 @@ def test_should_add_to_retry_queue_if_notification_not_found_in_deliver_sms_task
|
||||
deliver_sms(notification_id)
|
||||
app.delivery.send_to_providers.send_sms_to_provider.assert_not_called()
|
||||
app.celery.provider_tasks.deliver_sms.retry.assert_called_with(
|
||||
queue="retry-tasks", countdown=0
|
||||
queue="retry-tasks", countdown=0, expires=ANY
|
||||
)
|
||||
|
||||
|
||||
@@ -208,7 +209,7 @@ def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_sms_task(
|
||||
assert str(sample_notification.id) in str(e.value)
|
||||
|
||||
provider_tasks.deliver_sms.retry.assert_called_with(
|
||||
queue="retry-tasks", countdown=0
|
||||
queue="retry-tasks", countdown=0, expires=ANY
|
||||
)
|
||||
|
||||
assert sample_notification.status == NotificationStatus.TEMPORARY_FAILURE
|
||||
@@ -240,7 +241,7 @@ def test_should_add_to_retry_queue_if_notification_not_found_in_deliver_email_ta
|
||||
deliver_email(notification_id)
|
||||
app.delivery.send_to_providers.send_email_to_provider.assert_not_called()
|
||||
app.celery.provider_tasks.deliver_email.retry.assert_called_with(
|
||||
queue="retry-tasks"
|
||||
queue="retry-tasks", expires=ANY
|
||||
)
|
||||
|
||||
|
||||
@@ -268,7 +269,9 @@ def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_email_task
|
||||
deliver_email(sample_notification.id)
|
||||
assert str(sample_notification.id) in str(e.value)
|
||||
|
||||
provider_tasks.deliver_email.retry.assert_called_with(queue="retry-tasks")
|
||||
provider_tasks.deliver_email.retry.assert_called_with(
|
||||
queue="retry-tasks", expires=ANY
|
||||
)
|
||||
assert sample_notification.status == NotificationStatus.TECHNICAL_FAILURE
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user