mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Removed tests related to daily total key
This commit is contained in:
committed by
Carlo Costino
parent
a346a734fc
commit
1db57c289a
@@ -187,104 +187,6 @@ def test_persist_notification_cache_is_not_incremented_on_failure_to_create_noti
|
||||
mocked_redis.assert_not_called()
|
||||
|
||||
|
||||
# def test_persist_notification_does_not_increment_cache_if_test_key(
|
||||
# notify_api, sample_template, sample_job, mocker, sample_test_api_key
|
||||
# ):
|
||||
# mocker.patch(
|
||||
# "app.notifications.process_notifications.dao_get_notification_count_for_service",
|
||||
# return_value=1,
|
||||
# )
|
||||
#
|
||||
# assert Notification.query.count() == 0
|
||||
# assert NotificationHistory.query.count() == 0
|
||||
# with set_config(notify_api, "REDIS_ENABLED", True):
|
||||
# persist_notification(
|
||||
# template_id=sample_template.id,
|
||||
# template_version=sample_template.version,
|
||||
# recipient="+447111111111",
|
||||
# service=sample_template.service,
|
||||
# personalisation={},
|
||||
# notification_type="sms",
|
||||
# api_key_id=sample_test_api_key.id,
|
||||
# key_type=sample_test_api_key.key_type,
|
||||
# job_id=sample_job.id,
|
||||
# job_row_number=100,
|
||||
# reference="ref",
|
||||
# )
|
||||
#
|
||||
# assert Notification.query.count() == 1
|
||||
|
||||
|
||||
# @pytest.mark.parametrize("restricted_service", [True, False])
|
||||
# @freeze_time("2016-01-01 11:09:00.061258")
|
||||
# def test_persist_notification_increments_cache_for_trial_or_live_service(
|
||||
# notify_api, notify_db_session, mocker, restricted_service
|
||||
# ):
|
||||
# service = create_service(restricted=restricted_service)
|
||||
# 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(
|
||||
# template_id=template.id,
|
||||
# template_version=template.version,
|
||||
# recipient="+447111111122",
|
||||
# service=template.service,
|
||||
# personalisation={},
|
||||
# notification_type="sms",
|
||||
# api_key_id=api_key.id,
|
||||
# key_type=api_key.key_type,
|
||||
# reference="ref2",
|
||||
# )
|
||||
#
|
||||
# assert mock_incr.call_count == 1
|
||||
# mock_incr.assert_has_calls(
|
||||
# [
|
||||
# # call(str(service.id) + "-2016-01-01-count", ),
|
||||
# call(
|
||||
# "2016-01-01-total",
|
||||
# )
|
||||
# ]
|
||||
# )
|
||||
|
||||
|
||||
# @pytest.mark.parametrize("restricted_service", [True, False])
|
||||
# @freeze_time("2016-01-01 11:09:00.061258")
|
||||
# def test_persist_notification_sets_daily_limit_cache_if_one_does_not_exists(
|
||||
# notify_api, notify_db_session, mocker, restricted_service
|
||||
# ):
|
||||
# service = create_service(restricted=restricted_service)
|
||||
# template = create_template(service=service)
|
||||
# api_key = create_api_key(service=service)
|
||||
# mocker.patch(
|
||||
# "app.notifications.process_notifications.redis_store.get", return_value=None
|
||||
# )
|
||||
# mock_set = mocker.patch("app.notifications.process_notifications.redis_store.set")
|
||||
# with set_config(notify_api, "REDIS_ENABLED", True):
|
||||
# persist_notification(
|
||||
# template_id=template.id,
|
||||
# template_version=template.version,
|
||||
# recipient="+447111111122",
|
||||
# service=template.service,
|
||||
# personalisation={},
|
||||
# notification_type="sms",
|
||||
# api_key_id=api_key.id,
|
||||
# key_type=api_key.key_type,
|
||||
# reference="ref2",
|
||||
# )
|
||||
#
|
||||
# assert mock_set.call_count == 1
|
||||
# mock_set.assert_has_calls(
|
||||
# [
|
||||
# # call(str(service.id) + "-2016-01-01-count", 1, ex=86400),
|
||||
# call("2016-01-01-total", 1, ex=86400)
|
||||
# ]
|
||||
# )
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("requested_queue, notification_type, key_type, expected_queue, expected_task"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user