mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
- change the condition so that we don't reset the cache if it's zero
- set the cache if it doesn't exist so there is an expiry of 24 hours.
This commit is contained in:
@@ -202,6 +202,7 @@ def test_persist_notification_increments_cache_for_trial_service(
|
||||
service = create_service(restricted=True)
|
||||
template = create_template(service=service)
|
||||
api_key = create_api_key(service=service)
|
||||
mocker.patch('app.notifications.process_notifications.redis_store.get', return_value=1)
|
||||
mock_incr = mocker.patch('app.notifications.process_notifications.redis_store.incr')
|
||||
with set_config(notify_api, 'REDIS_ENABLED', True):
|
||||
persist_notification(
|
||||
@@ -224,6 +225,7 @@ def test_persist_notification_increments_cache_live_service(
|
||||
service = create_service(restricted=False)
|
||||
template = create_template(service=service)
|
||||
api_key = create_api_key(service=service)
|
||||
mocker.patch('app.notifications.process_notifications.redis_store.get', return_value=1)
|
||||
mock_incr = mocker.patch('app.notifications.process_notifications.redis_store.incr')
|
||||
with set_config(notify_api, 'REDIS_ENABLED', True):
|
||||
persist_notification(
|
||||
|
||||
Reference in New Issue
Block a user