mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
don't swallow HTTP errors from create_event
tests weren't patching out create_event (which is invoked every time a user logs in). This was getting caught by our egress proxy on jenkins. We didn't notice because the event handler code was swallowing all exceptions and not re-raising. This changes that code to no longer swallow exceptions. Since we did that, we also need to update all the tests that test log-in to mock the call
This commit is contained in:
@@ -2923,3 +2923,14 @@ def mock_get_organisations_and_services_for_user(mocker, organisation_one, api_u
|
||||
'app.user_api_client.get_organisations_and_services_for_user',
|
||||
side_effect=_get_orgs_and_services
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_create_event(mocker):
|
||||
"""
|
||||
This should be used whenever your code is calling `flask_login.login_user`
|
||||
"""
|
||||
def _add_event(event_type, event_data):
|
||||
return
|
||||
|
||||
return mocker.patch('app.events_api_client.create_event', side_effect=_add_event)
|
||||
|
||||
Reference in New Issue
Block a user