-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove FF_EMAIL_DAILY_LIMIT feature flag (#2096)
* Remove FF_EMAIL_DAILY_LIMIT feature flag * Various test fixes * Fix tests, squashed a bug --------- Co-authored-by: Jumana B <[email protected]>
- Loading branch information
Showing
11 changed files
with
36 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,11 @@ | |
Template, | ||
) | ||
from app.utils import get_document_url | ||
from app.v2.errors import RateLimitError, TooManyRequestsError | ||
from app.v2.errors import ( | ||
RateLimitError, | ||
TooManyRequestsError, | ||
TrialServiceTooManyEmailRequestsError, | ||
) | ||
from tests import create_authorization_header | ||
from tests.app.conftest import ( | ||
create_sample_api_key, | ||
|
@@ -385,7 +389,7 @@ def test_should_block_api_call_if_over_day_limit_for_live_service(notify_db, not | |
with notify_api.test_request_context(): | ||
with notify_api.test_client() as client: | ||
mocker.patch( | ||
"app.notifications.validators.check_service_over_daily_message_limit", | ||
"app.notifications.validators.check_service_over_api_rate_limit_and_update_rate", | ||
side_effect=TooManyRequestsError(1), | ||
) | ||
mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") | ||
|
@@ -417,13 +421,14 @@ def test_should_block_api_call_if_over_day_limit_for_live_service(notify_db, not | |
def test_should_block_api_call_if_over_day_limit_for_restricted_service(notify_db, notify_db_session, notify_api, mocker): | ||
with notify_api.test_request_context(): | ||
with notify_api.test_client() as client: | ||
mocker.patch("app.celery.provider_tasks.deliver_sms.apply_async") | ||
mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") | ||
mocker.patch( | ||
"app.notifications.validators.check_service_over_daily_message_limit", | ||
side_effect=TooManyRequestsError(1), | ||
"app.notifications.validators.check_email_daily_limit", | ||
side_effect=TrialServiceTooManyEmailRequestsError(1), | ||
) | ||
|
||
service = create_sample_service(notify_db, notify_db_session, limit=1, restricted=True) | ||
create_sample_service_safelist(notify_db, notify_db_session, service=service, email_address="[email protected]") | ||
email_template = create_sample_email_template(notify_db, notify_db_session, service=service) | ||
create_sample_notification( | ||
notify_db, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters