mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-16 19:30:13 -04:00
make sure mock login sets up session correctly
This commit is contained in:
@@ -14,6 +14,7 @@ class TestClient(FlaskClient):
|
||||
def login(self, user, mocker=None, service=None):
|
||||
# Skipping authentication here and just log them in
|
||||
with self.session_transaction() as session:
|
||||
session['current_session_id'] = user.current_session_id
|
||||
session['user_id'] = user.id
|
||||
if mocker:
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user)
|
||||
@@ -63,6 +64,7 @@ def user_json(
|
||||
platform_admin=False,
|
||||
current_session_id='1234',
|
||||
organisations=[],
|
||||
services=[]
|
||||
|
||||
):
|
||||
return {
|
||||
@@ -78,7 +80,8 @@ def user_json(
|
||||
'max_failed_login_count': max_failed_login_count,
|
||||
'platform_admin': platform_admin,
|
||||
'current_session_id': current_session_id,
|
||||
'organisations': organisations
|
||||
'organisations': organisations,
|
||||
'services': services or permissions.keys()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user