mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Record login including remembered user login events to the api based of flask login
signals.
This commit is contained in:
17
tests/app/main/notify_client/test_events_client.py
Normal file
17
tests/app/main/notify_client/test_events_client.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from app.notify_client.events_api_client import EventsApiClient
|
||||
|
||||
|
||||
def test_events_client_calls_correct_api_endpoint(mocker):
|
||||
|
||||
expected_url = '/events'
|
||||
event_type = 'anything'
|
||||
event_data = {'does_not': 'matter'}
|
||||
expected_data = {'event_type': event_type, 'data': event_data}
|
||||
|
||||
client = EventsApiClient()
|
||||
|
||||
mock_post = mocker.patch('app.notify_client.events_api_client.EventsApiClient.post')
|
||||
|
||||
client.create_event(event_type, event_data)
|
||||
|
||||
mock_post.assert_called_once_with(url=expected_url, data=expected_data)
|
||||
Reference in New Issue
Block a user