fix tests that expect to be rate limited (which is off if redis is disabled)

This commit is contained in:
Leo Hemsted
2017-12-04 14:13:43 +00:00
parent 88c878c83e
commit 5bb6b68e57
3 changed files with 21 additions and 10 deletions

View File

@@ -151,9 +151,13 @@ def test_send_one_off_notification_raises_if_cant_send_to_recipient(notify_db_se
assert 'service is in trial mode' in e.value.message
def test_send_one_off_notification_raises_if_over_limit(notify_db_session):
def test_send_one_off_notification_raises_if_over_limit(notify_db_session, mocker):
service = create_service(message_limit=0)
template = create_template(service=service)
mocker.patch(
'app.service.send_notification.check_service_over_daily_message_limit',
side_effect=TooManyRequestsError(1)
)
post_data = {
'template_id': str(template.id),