mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Audit permissions when adding a user to a service
This is useful information to store for the event, which would be lost if someone subsequently changed them. Rather than updating lots of mock assertions, I've replaced them with a single test / assert at a lower level, which is consistent with auditing being a non-critical function.
This commit is contained in:
@@ -334,8 +334,6 @@ def test_register_from_email_auth_invite(
|
||||
fake_uuid,
|
||||
mocker,
|
||||
):
|
||||
mock_audit_event = mocker.patch('app.models.user.create_add_user_to_service_event')
|
||||
|
||||
sample_invite['auth_type'] = 'email_auth'
|
||||
sample_invite['email_address'] = invite_email_address
|
||||
with client.session_transaction() as session:
|
||||
@@ -373,10 +371,6 @@ def test_register_from_email_auth_invite(
|
||||
assert current_user.is_authenticated
|
||||
assert mock_add_user_to_service.called
|
||||
|
||||
mock_audit_event.assert_called_once_with(invited_by_id=service_one['users'][0],
|
||||
service_id=sample_invite['service'],
|
||||
user_id=fake_uuid)
|
||||
|
||||
with client.session_transaction() as session:
|
||||
# invited user details are still there so they can get added to the service
|
||||
assert session['invited_user_id'] == sample_invite['id']
|
||||
|
||||
Reference in New Issue
Block a user