mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Merge with new master.
This commit is contained in:
13
tests/app/main/notify_client/test_statistics_client.py
Normal file
13
tests/app/main/notify_client/test_statistics_client.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from app.notify_client.statistics_api_client import StatisticsApiClient
|
||||
|
||||
|
||||
def test_client_uses_correct_find_by_email(mocker, api_user_active):
|
||||
|
||||
expected_url = '/service/a1b2c3d4/notifications-statistics'
|
||||
|
||||
client = StatisticsApiClient()
|
||||
mock_get = mocker.patch('app.notify_client.statistics_api_client.StatisticsApiClient.get')
|
||||
|
||||
client.get_statistics_for_service('a1b2c3d4')
|
||||
|
||||
mock_get.assert_called_once_with(url=expected_url)
|
||||
@@ -175,7 +175,7 @@ def test_new_user_accept_invite_calls_api_and_views_registration_page(app_,
|
||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||
assert page.h1.string.strip() == 'Create an account'
|
||||
|
||||
email_in_page = page.find('p')
|
||||
email_in_page = page.find('main').find('p')
|
||||
assert email_in_page.text.strip() == 'Your account will be created with this email: invited_user@test.gov.uk' # noqa
|
||||
|
||||
form = page.find('form')
|
||||
@@ -275,6 +275,7 @@ def test_new_invited_user_verifies_and_added_to_service(app_,
|
||||
mock_accept_invite,
|
||||
mock_get_service,
|
||||
mock_get_service_templates,
|
||||
mock_get_service_statistics,
|
||||
mock_get_jobs):
|
||||
|
||||
with app_.test_request_context():
|
||||
|
||||
@@ -6,6 +6,7 @@ def test_should_show_recent_jobs_on_dashboard(app_,
|
||||
api_user_active,
|
||||
mock_get_service,
|
||||
mock_get_service_templates,
|
||||
mock_get_service_statistics,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_login,
|
||||
@@ -34,6 +35,7 @@ def _test_dashboard_menu(mocker, app_, usr, service, permissions):
|
||||
mocker.patch('app.user_api_client.get_user', return_value=usr)
|
||||
mocker.patch('app.user_api_client.get_user_by_email', return_value=usr)
|
||||
mocker.patch('app.notifications_api_client.get_service', return_value={'data': service})
|
||||
mocker.patch('app.statistics_api_client.get_statistics_for_service', return_value={'data': [{}]})
|
||||
client.login(usr)
|
||||
return client.get(url_for('main.service_dashboard', service_id=service['id']))
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ def test_sign_out_user(app_,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_get_service_templates,
|
||||
mock_get_service_statistics,
|
||||
mock_login,
|
||||
mock_get_jobs):
|
||||
with app_.test_request_context():
|
||||
|
||||
Reference in New Issue
Block a user