mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 01:19:27 -04:00
TestClient now sets up app.current_session correctly
previously it was attempting to do so from outside of a session transaction, so failing. This still only happens when you've called `login` with a mocker and service json blob, which is probably worth reconsidering in the future, but for now, updated logged_in_client to use the extra login args
This commit is contained in:
committed by
Chris Hill-Scott
parent
d2680fe885
commit
154271b46e
@@ -18,7 +18,8 @@ class TestClient(FlaskClient):
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user)
|
||||
mocker.patch('app.events_api_client.create_event')
|
||||
if mocker and service:
|
||||
session['service_id'] = service['id']
|
||||
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, remember=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user