mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-16 19:30:13 -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:
@@ -1,3 +1,4 @@
|
||||
from unittest.mock import patch
|
||||
import pytest
|
||||
import uuid
|
||||
|
||||
@@ -18,12 +19,13 @@ class TestClient(FlaskClient):
|
||||
session['user_id'] = user.id
|
||||
if mocker:
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user)
|
||||
mocker.patch('app.events_api_client.create_event')
|
||||
if mocker and service:
|
||||
with self.session_transaction() as session:
|
||||
session['service_id'] = service['id']
|
||||
mocker.patch('app.service_api_client.get_service', return_value={'data': service})
|
||||
login_user(user)
|
||||
|
||||
with patch('app.events_api_client.create_event'):
|
||||
login_user(user)
|
||||
|
||||
def logout(self, user):
|
||||
self.get(url_for("main.logout"))
|
||||
|
||||
Reference in New Issue
Block a user