mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 20:18:24 -04:00
Add event for remove_user_from_service
Follows our existing patterns of events for managing users
This commit is contained in:
@@ -5,6 +5,7 @@ from app.event_handlers import (
|
||||
create_archive_user_event,
|
||||
create_email_change_event,
|
||||
create_mobile_number_change_event,
|
||||
create_remove_user_from_service_event,
|
||||
on_user_logged_in,
|
||||
)
|
||||
from app.models.user import User
|
||||
@@ -37,6 +38,26 @@ def test_create_email_change_event_calls_events_api(app_, mock_events):
|
||||
'new_email_address': 'new@example.com'})
|
||||
|
||||
|
||||
def test_create_remove_user_from_service_event_calls_events_api(app_, mock_events):
|
||||
user_id = str(uuid.uuid4())
|
||||
removed_by_id = str(uuid.uuid4())
|
||||
service_id = str(uuid.uuid4())
|
||||
|
||||
with app_.test_request_context():
|
||||
create_remove_user_from_service_event(user_id, removed_by_id, service_id)
|
||||
|
||||
mock_events.assert_called_with(
|
||||
'remove_user_from_service',
|
||||
{
|
||||
'browser_fingerprint': {'browser': ANY, 'version': ANY, 'platform': ANY, 'user_agent_string': ''},
|
||||
'ip_address': ANY,
|
||||
'user_id': user_id,
|
||||
'removed_by_id': removed_by_id,
|
||||
'service_id': service_id,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def test_create_mobile_number_change_event_calls_events_api(app_, mock_events):
|
||||
user_id = str(uuid.uuid4())
|
||||
updated_by_id = str(uuid.uuid4())
|
||||
|
||||
Reference in New Issue
Block a user