Send notification emails on some http errors
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import pytest
|
||||
from flask import url_for
|
||||
from copy import copy
|
||||
from tests.factories import UserFactory
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -20,3 +22,16 @@ def test_csrf_error(csrf_enabled_app, client):
|
||||
body = response.data.decode()
|
||||
assert "Session Expired" in body
|
||||
assert "Log in required" in body
|
||||
|
||||
|
||||
def test_errors_generate_notifications(app, client, user_session, notification_sender):
|
||||
user_session(UserFactory.create())
|
||||
new_app = copy(app)
|
||||
|
||||
@new_app.route("/throw")
|
||||
def throw():
|
||||
raise ValueError()
|
||||
|
||||
new_app.test_client().get("/throw")
|
||||
|
||||
notification_sender.send.assert_called_once()
|
||||
|
Reference in New Issue
Block a user