mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
Removed/replaced retention redis count with notification count from db call
This commit is contained in:
committed by
Carlo Costino
parent
246e23f193
commit
a346a734fc
@@ -55,11 +55,31 @@ def enable_redis(notify_api):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key_type", ["team", "normal"])
|
||||
def test_check_service_message_limit_over_total_limit_fails(
|
||||
def test_check_service_over_total_message_limit_fails(
|
||||
key_type, mocker, notify_db_session
|
||||
):
|
||||
service = create_service()
|
||||
mocker.patch("app.redis_store.get", return_value="5001")
|
||||
mocker.patch(
|
||||
"app.redis_store.get",
|
||||
return_value="250001",
|
||||
)
|
||||
|
||||
with pytest.raises(TotalRequestsError) as e:
|
||||
check_service_over_total_message_limit(key_type, service)
|
||||
assert e.value.status_code == 429
|
||||
assert e.value.message == "Exceeded total application limits (250000) for today"
|
||||
assert e.value.fields == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key_type", ["team", "normal"])
|
||||
def test_check_application_over_retention_limit_fails(
|
||||
key_type, mocker, notify_db_session
|
||||
):
|
||||
service = create_service()
|
||||
mocker.patch(
|
||||
"app.notifications.validators.dao_get_notification_count_for_service",
|
||||
return_value="5001",
|
||||
)
|
||||
|
||||
with pytest.raises(TotalRequestsError) as e:
|
||||
check_application_over_retention_limit(key_type, service)
|
||||
|
||||
Reference in New Issue
Block a user