2017-10-05 10:46:55 +01:00
|
|
|
|
import pytest
|
2021-10-11 17:41:23 +01:00
|
|
|
|
from flask import url_for
|
2021-03-05 15:03:23 +00:00
|
|
|
|
from freezegun import freeze_time
|
2021-02-15 11:41:26 +00:00
|
|
|
|
from notifications_python_client.errors import HTTPError
|
2017-08-07 11:30:25 +01:00
|
|
|
|
|
2021-06-09 13:19:05 +01:00
|
|
|
|
from app.utils.user import is_gov_user
|
2023-07-12 12:09:44 -04:00
|
|
|
|
from tests import organization_json
|
2019-12-20 15:02:47 +00:00
|
|
|
|
from tests.conftest import normalize_spaces
|
2016-03-31 15:17:05 +01:00
|
|
|
|
|
2015-12-14 17:12:28 +00:00
|
|
|
|
|
2017-02-03 10:42:01 +00:00
|
|
|
|
def test_non_gov_user_cannot_see_add_service_button(
|
2022-01-04 10:56:25 +00:00
|
|
|
|
client_request,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
mock_login,
|
|
|
|
|
|
mock_get_non_govuser,
|
|
|
|
|
|
api_nongov_user_active,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_organizations,
|
|
|
|
|
|
mock_get_organizations_and_services_for_user,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2022-01-04 10:56:25 +00:00
|
|
|
|
client_request.login(api_nongov_user_active)
|
|
|
|
|
|
page = client_request.get('main.choose_account')
|
|
|
|
|
|
assert 'Add a new service' not in page.text
|
2016-10-30 09:20:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
2019-05-03 13:35:52 +01:00
|
|
|
|
@pytest.mark.parametrize('org_json', (
|
|
|
|
|
|
None,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
organization_json(organization_type=None),
|
2019-05-03 13:35:52 +01:00
|
|
|
|
))
|
2017-02-03 10:42:01 +00:00
|
|
|
|
def test_get_should_render_add_service_template(
|
2019-04-18 12:44:18 +01:00
|
|
|
|
client_request,
|
2019-05-03 13:35:52 +01:00
|
|
|
|
mocker,
|
|
|
|
|
|
org_json,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-05-03 13:35:52 +01:00
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
2019-05-03 13:35:52 +01:00
|
|
|
|
return_value=org_json,
|
|
|
|
|
|
)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
page = client_request.get('main.add_service')
|
2019-04-18 12:44:18 +01:00
|
|
|
|
assert page.select_one('h1').text.strip() == 'About your service'
|
2020-08-07 12:18:29 +01:00
|
|
|
|
assert page.select_one('input[name=name]').get('value') is None
|
2019-04-18 12:44:18 +01:00
|
|
|
|
assert [
|
2020-06-26 20:39:20 +01:00
|
|
|
|
label.text.strip() for label in page.select('.govuk-radios__item label')
|
2019-04-18 12:44:18 +01:00
|
|
|
|
] == [
|
2022-09-15 18:47:04 +00:00
|
|
|
|
'Federal government',
|
|
|
|
|
|
'State government',
|
2019-07-15 18:03:59 +01:00
|
|
|
|
'Other',
|
2019-04-18 12:44:18 +01:00
|
|
|
|
]
|
|
|
|
|
|
assert [
|
2020-06-26 20:39:20 +01:00
|
|
|
|
radio['value'] for radio in page.select('.govuk-radios__item input')
|
2019-04-18 12:44:18 +01:00
|
|
|
|
] == [
|
2022-09-15 18:47:04 +00:00
|
|
|
|
'federal',
|
|
|
|
|
|
'state',
|
2019-07-15 18:03:59 +01:00
|
|
|
|
'other',
|
2019-04-18 12:44:18 +01:00
|
|
|
|
]
|
2015-12-14 17:12:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
2019-04-18 12:44:18 +01:00
|
|
|
|
def test_get_should_not_render_radios_if_org_type_known(
|
|
|
|
|
|
client_request,
|
|
|
|
|
|
mocker,
|
|
|
|
|
|
):
|
2019-12-20 15:02:47 +00:00
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
|
|
|
|
|
return_value=organization_json(organization_type='central'),
|
2019-12-20 15:02:47 +00:00
|
|
|
|
)
|
2019-04-18 12:44:18 +01:00
|
|
|
|
page = client_request.get('main.add_service')
|
|
|
|
|
|
assert page.select_one('h1').text.strip() == 'About your service'
|
2020-08-07 12:18:29 +01:00
|
|
|
|
assert page.select_one('input[name=name]').get('value') is None
|
2019-04-18 12:44:18 +01:00
|
|
|
|
assert not page.select('.multiple-choice')
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-01 11:18:20 +01:00
|
|
|
|
def test_show_different_page_if_user_org_type_is_local(
|
|
|
|
|
|
client_request,
|
|
|
|
|
|
mocker,
|
|
|
|
|
|
):
|
|
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
|
|
|
|
|
return_value=organization_json(organization_type='local'),
|
2020-07-01 11:18:20 +01:00
|
|
|
|
)
|
|
|
|
|
|
page = client_request.get('main.add_service')
|
|
|
|
|
|
assert page.select_one('h1').text.strip() == 'About your service'
|
2020-08-07 12:18:29 +01:00
|
|
|
|
assert page.select_one('input[name=name]').get('value') is None
|
2023-06-06 15:28:24 -04:00
|
|
|
|
assert page.select_one('main .usa-body').text.strip() == (
|
2020-07-01 11:49:11 +01:00
|
|
|
|
'Give your service a name that tells users what your '
|
2020-07-01 11:18:20 +01:00
|
|
|
|
'messages are about, as well as who they’re from. For example:')
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-07 10:31:16 +01:00
|
|
|
|
@pytest.mark.parametrize('email_address', (
|
2023-01-05 14:35:37 -05:00
|
|
|
|
# User’s email address doesn’t matter when the organization is known
|
2022-08-05 00:25:03 -07:00
|
|
|
|
'test@example.gsa.gov',
|
|
|
|
|
|
'test@anotherexample.gsa.gov',
|
2019-05-07 10:31:16 +01:00
|
|
|
|
))
|
2019-04-18 12:44:18 +01:00
|
|
|
|
@pytest.mark.parametrize('inherited, posted, persisted, sms_limit', (
|
2022-09-15 18:47:04 +00:00
|
|
|
|
(None, 'federal', 'federal', 150_000),
|
|
|
|
|
|
# ('federal', None, 'federal', 150_000),
|
|
|
|
|
|
(None, 'state', 'state', 150_000),
|
|
|
|
|
|
# ('state', None, 'state', 150_000),
|
2019-04-18 12:44:18 +01:00
|
|
|
|
))
|
2021-03-05 15:03:23 +00:00
|
|
|
|
@freeze_time("2021-01-01")
|
2017-02-03 10:42:01 +00:00
|
|
|
|
def test_should_add_service_and_redirect_to_tour_when_no_services(
|
2019-04-18 12:44:18 +01:00
|
|
|
|
mocker,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
mock_create_service,
|
|
|
|
|
|
mock_create_service_template,
|
|
|
|
|
|
mock_get_services_with_no_services,
|
|
|
|
|
|
api_user_active,
|
2018-09-03 11:46:41 +01:00
|
|
|
|
mock_get_all_email_branding,
|
2019-04-18 12:44:18 +01:00
|
|
|
|
inherited,
|
2019-05-07 10:31:16 +01:00
|
|
|
|
email_address,
|
2019-04-18 12:44:18 +01:00
|
|
|
|
posted,
|
|
|
|
|
|
persisted,
|
|
|
|
|
|
sms_limit,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-05-23 15:27:35 +01:00
|
|
|
|
api_user_active['email_address'] = email_address
|
2019-05-07 10:31:16 +01:00
|
|
|
|
client_request.login(api_user_active)
|
2019-12-20 15:02:47 +00:00
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
|
|
|
|
|
return_value=organization_json(organization_type=inherited),
|
2019-12-20 15:02:47 +00:00
|
|
|
|
)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request.post(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_data={
|
2017-10-04 11:49:32 +01:00
|
|
|
|
'name': 'testing the post',
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'organization_type': posted,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
},
|
|
|
|
|
|
_expected_status=302,
|
|
|
|
|
|
_expected_redirect=url_for(
|
2020-09-30 14:23:15 +01:00
|
|
|
|
'main.begin_tour',
|
2019-03-26 12:35:32 +00:00
|
|
|
|
service_id=101,
|
|
|
|
|
|
template_id="Example%20text%20message%20template",
|
|
|
|
|
|
),
|
2017-10-04 11:49:32 +01:00
|
|
|
|
)
|
2017-02-03 12:07:21 +00:00
|
|
|
|
assert mock_get_services_with_no_services.called
|
|
|
|
|
|
mock_create_service.assert_called_once_with(
|
2018-04-19 14:01:45 +01:00
|
|
|
|
service_name='testing the post',
|
2023-07-12 12:09:44 -04:00
|
|
|
|
organization_type=persisted,
|
2019-04-18 12:44:18 +01:00
|
|
|
|
message_limit=50,
|
2018-04-19 14:01:45 +01:00
|
|
|
|
restricted=True,
|
2019-05-23 15:27:35 +01:00
|
|
|
|
user_id=api_user_active['id'],
|
2019-02-12 14:02:21 +00:00
|
|
|
|
email_from='testing.the.post',
|
2017-02-03 12:07:21 +00:00
|
|
|
|
)
|
2017-03-09 10:30:19 +00:00
|
|
|
|
mock_create_service_template.assert_called_once_with(
|
|
|
|
|
|
'Example text message template',
|
|
|
|
|
|
'sms',
|
|
|
|
|
|
(
|
2022-12-06 11:03:47 -05:00
|
|
|
|
"Hi, I’m trying out U.S. Notify. Today is "
|
2023-05-08 10:49:30 -04:00
|
|
|
|
"((day of week)) and my favorite color is ((color))."
|
2017-03-09 10:30:19 +00:00
|
|
|
|
),
|
|
|
|
|
|
101,
|
|
|
|
|
|
)
|
2021-10-11 17:41:23 +01:00
|
|
|
|
with client_request.session_transaction() as session:
|
|
|
|
|
|
assert session['service_id'] == 101
|
2016-04-28 16:44:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:16:23 +01:00
|
|
|
|
def test_add_service_has_to_choose_org_type(
|
|
|
|
|
|
mocker,
|
|
|
|
|
|
client_request,
|
|
|
|
|
|
mock_create_service,
|
|
|
|
|
|
mock_create_service_template,
|
|
|
|
|
|
mock_get_services_with_no_services,
|
|
|
|
|
|
api_user_active,
|
|
|
|
|
|
mock_get_all_email_branding,
|
|
|
|
|
|
):
|
|
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
2019-05-15 16:16:23 +01:00
|
|
|
|
return_value=None,
|
|
|
|
|
|
)
|
|
|
|
|
|
page = client_request.post(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_data={
|
|
|
|
|
|
'name': 'testing the post',
|
|
|
|
|
|
},
|
|
|
|
|
|
_expected_status=200,
|
|
|
|
|
|
)
|
2023-06-08 13:12:00 -04:00
|
|
|
|
assert normalize_spaces(page.select_one('.usa-error-message').text) == (
|
2023-01-05 14:35:37 -05:00
|
|
|
|
'Error: Select the type of organization'
|
2019-05-15 16:16:23 +01:00
|
|
|
|
)
|
|
|
|
|
|
assert mock_create_service.called is False
|
|
|
|
|
|
assert mock_create_service_template.called is False
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-07 10:31:16 +01:00
|
|
|
|
@pytest.mark.parametrize('email_address', (
|
|
|
|
|
|
'test@nhs.net',
|
|
|
|
|
|
'test@nhs.uk',
|
|
|
|
|
|
'test@example.NhS.uK',
|
|
|
|
|
|
'test@EXAMPLE.NHS.NET',
|
|
|
|
|
|
))
|
2022-08-05 01:22:32 -07:00
|
|
|
|
@pytest.mark.skip(reason='Update for TTS')
|
2019-07-16 15:37:27 +01:00
|
|
|
|
def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
|
2019-05-07 10:31:16 +01:00
|
|
|
|
client_request,
|
2019-07-16 15:37:27 +01:00
|
|
|
|
mocker,
|
2019-05-07 10:31:16 +01:00
|
|
|
|
api_user_active,
|
|
|
|
|
|
email_address,
|
|
|
|
|
|
):
|
2019-05-23 15:27:35 +01:00
|
|
|
|
api_user_active['email_address'] = email_address
|
2019-05-07 10:31:16 +01:00
|
|
|
|
client_request.login(api_user_active)
|
|
|
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'app.organizations_client.get_organization_by_domain',
|
2019-05-07 10:31:16 +01:00
|
|
|
|
return_value=None,
|
|
|
|
|
|
)
|
2019-07-16 15:37:27 +01:00
|
|
|
|
page = client_request.get('main.add_service')
|
|
|
|
|
|
assert page.select_one('h1').text.strip() == 'About your service'
|
2020-08-07 12:18:29 +01:00
|
|
|
|
assert page.select_one('input[name=name]').get('value') is None
|
2019-07-16 15:37:27 +01:00
|
|
|
|
assert [
|
2020-06-26 20:39:20 +01:00
|
|
|
|
label.text.strip() for label in page.select('.govuk-radios__item label')
|
2019-07-16 15:37:27 +01:00
|
|
|
|
] == [
|
|
|
|
|
|
'NHS – central government agency or public body',
|
|
|
|
|
|
'NHS Trust or Clinical Commissioning Group',
|
|
|
|
|
|
'GP practice',
|
|
|
|
|
|
]
|
|
|
|
|
|
assert [
|
2020-06-26 20:39:20 +01:00
|
|
|
|
radio['value'] for radio in page.select('.govuk-radios__item input')
|
2019-07-16 15:37:27 +01:00
|
|
|
|
] == [
|
|
|
|
|
|
'nhs_central',
|
|
|
|
|
|
'nhs_local',
|
2019-08-27 16:26:50 +01:00
|
|
|
|
'nhs_gp',
|
2019-07-16 15:37:27 +01:00
|
|
|
|
]
|
2019-05-07 10:31:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
2023-07-12 12:09:44 -04:00
|
|
|
|
@pytest.mark.parametrize('organization_type, free_allowance', [
|
2022-09-15 18:47:04 +00:00
|
|
|
|
('federal', 150_000),
|
|
|
|
|
|
('state', 150_000),
|
2017-10-05 10:46:55 +01:00
|
|
|
|
])
|
2017-02-03 10:42:01 +00:00
|
|
|
|
def test_should_add_service_and_redirect_to_dashboard_when_existing_service(
|
2021-05-12 14:57:21 +01:00
|
|
|
|
notify_admin,
|
2020-03-20 08:42:33 +00:00
|
|
|
|
mocker,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
mock_create_service,
|
|
|
|
|
|
mock_create_service_template,
|
|
|
|
|
|
mock_get_services,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_no_organization_by_domain,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
api_user_active,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
organization_type,
|
2017-10-05 10:46:55 +01:00
|
|
|
|
free_allowance,
|
2018-09-03 11:46:41 +01:00
|
|
|
|
mock_get_all_email_branding,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request.post(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_data={
|
2017-10-04 11:49:32 +01:00
|
|
|
|
'name': 'testing the post',
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'organization_type': organization_type,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
},
|
|
|
|
|
|
_expected_status=302,
|
|
|
|
|
|
_expected_redirect=url_for(
|
|
|
|
|
|
'main.service_dashboard',
|
|
|
|
|
|
service_id=101,
|
|
|
|
|
|
)
|
2017-10-04 11:49:32 +01:00
|
|
|
|
)
|
2017-02-03 12:07:21 +00:00
|
|
|
|
assert mock_get_services.called
|
|
|
|
|
|
mock_create_service.assert_called_once_with(
|
2018-04-19 14:01:45 +01:00
|
|
|
|
service_name='testing the post',
|
2023-07-12 12:09:44 -04:00
|
|
|
|
organization_type=organization_type,
|
2021-05-12 14:57:21 +01:00
|
|
|
|
message_limit=notify_admin.config['DEFAULT_SERVICE_LIMIT'],
|
2018-04-19 14:01:45 +01:00
|
|
|
|
restricted=True,
|
2019-05-23 15:27:35 +01:00
|
|
|
|
user_id=api_user_active['id'],
|
2019-02-12 14:02:21 +00:00
|
|
|
|
email_from='testing.the.post',
|
2017-02-03 12:07:21 +00:00
|
|
|
|
)
|
|
|
|
|
|
assert len(mock_create_service_template.call_args_list) == 0
|
2021-10-11 17:41:23 +01:00
|
|
|
|
with client_request.session_transaction() as session:
|
|
|
|
|
|
assert session['service_id'] == 101
|
2015-12-15 10:17:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
2020-11-30 17:08:40 +00:00
|
|
|
|
@pytest.mark.parametrize('name, error_message', [
|
|
|
|
|
|
('', 'Cannot be empty'),
|
|
|
|
|
|
('.', 'Must include at least two alphanumeric characters'),
|
|
|
|
|
|
('a' * 256, 'Service name must be 255 characters or fewer'),
|
|
|
|
|
|
])
|
|
|
|
|
|
def test_add_service_fails_if_service_name_fails_validation(
|
2019-04-18 12:44:18 +01:00
|
|
|
|
client_request,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_organization_by_domain,
|
2020-11-30 17:08:40 +00:00
|
|
|
|
name,
|
|
|
|
|
|
error_message,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-03-26 12:35:32 +00:00
|
|
|
|
page = client_request.post(
|
|
|
|
|
|
'main.add_service',
|
2020-11-30 17:08:40 +00:00
|
|
|
|
_data={"name": name},
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_expected_status=200,
|
|
|
|
|
|
)
|
2023-06-08 13:12:00 -04:00
|
|
|
|
assert error_message in page.find("span", {"class": "usa-error-message"}).text
|
2019-11-08 17:12:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
2021-03-05 15:03:23 +00:00
|
|
|
|
@freeze_time("2021-01-01")
|
2017-02-03 10:42:01 +00:00
|
|
|
|
def test_should_return_form_errors_with_duplicate_service_name_regardless_of_case(
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_organization_by_domain,
|
2021-02-15 11:41:26 +00:00
|
|
|
|
mocker,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2021-02-15 11:41:26 +00:00
|
|
|
|
def _create(**_kwargs):
|
|
|
|
|
|
json_mock = mocker.Mock(return_value={'message': {'name': ["Duplicate service name"]}})
|
|
|
|
|
|
resp_mock = mocker.Mock(status_code=400, json=json_mock)
|
|
|
|
|
|
http_error = HTTPError(response=resp_mock, message="Default message")
|
|
|
|
|
|
raise http_error
|
|
|
|
|
|
|
|
|
|
|
|
mocker.patch(
|
|
|
|
|
|
'app.service_api_client.create_service',
|
|
|
|
|
|
side_effect=_create
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2019-03-26 12:35:32 +00:00
|
|
|
|
page = client_request.post(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_data={
|
2017-10-04 11:49:32 +01:00
|
|
|
|
'name': 'SERVICE ONE',
|
2023-07-12 12:09:44 -04:00
|
|
|
|
'organization_type': 'federal',
|
2017-10-04 11:49:32 +01:00
|
|
|
|
},
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_expected_status=200,
|
|
|
|
|
|
)
|
2023-06-08 13:12:00 -04:00
|
|
|
|
assert 'This service name is already in use' in page.select_one('.usa-error-message').text.strip()
|
2016-10-25 18:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
2020-06-12 09:15:23 +01:00
|
|
|
|
def test_non_government_user_cannot_access_create_service_page(
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
mock_get_non_govuser,
|
|
|
|
|
|
api_nongov_user_active,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_organizations,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-05-23 15:27:35 +01:00
|
|
|
|
assert is_gov_user(api_nongov_user_active['email_address']) is False
|
2023-01-19 17:29:21 -05:00
|
|
|
|
client_request.login(api_nongov_user_active)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request.get(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_expected_status=403,
|
|
|
|
|
|
)
|
2016-10-28 10:48:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
2020-06-12 09:15:23 +01:00
|
|
|
|
def test_non_government_user_cannot_create_service(
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
mock_get_non_govuser,
|
|
|
|
|
|
api_nongov_user_active,
|
2023-07-12 12:09:44 -04:00
|
|
|
|
mock_get_organizations,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2019-05-23 15:27:35 +01:00
|
|
|
|
assert is_gov_user(api_nongov_user_active['email_address']) is False
|
2023-01-19 17:29:21 -05:00
|
|
|
|
client_request.login(api_nongov_user_active)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request.post(
|
|
|
|
|
|
'main.add_service',
|
|
|
|
|
|
_data={'name': 'SERVICE TWO'},
|
|
|
|
|
|
_expected_status=403,
|
|
|
|
|
|
)
|