Send notification emails on some http errors

This commit is contained in:
richard-dds
2019-05-15 14:31:16 -04:00
parent d8e75668b0
commit fe5def3a92
4 changed files with 26 additions and 8 deletions

View File

@@ -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()