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
|
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)
|
2023-08-25 09:12:23 -07:00
|
|
|
|
page = client_request.get("main.choose_account")
|
|
|
|
|
|
assert "Add a new service" not in page.text
|
2016-10-30 09:20:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
|
"org_json",
|
2023-09-25 17:55:42 -04:00
|
|
|
|
[
|
2023-08-25 09:12:23 -07:00
|
|
|
|
None,
|
|
|
|
|
|
organization_json(organization_type=None),
|
2023-09-25 17:55:42 -04:00
|
|
|
|
],
|
2023-08-25 09:12:23 -07: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,
|
2023-10-23 14:41:31 -07:00
|
|
|
|
platform_admin_user,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-05-03 13:35:52 +01:00
|
|
|
|
mocker.patch(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
2019-05-03 13:35:52 +01:00
|
|
|
|
return_value=org_json,
|
|
|
|
|
|
)
|
2023-08-25 09:12:23 -07:00
|
|
|
|
page = client_request.get("main.add_service")
|
|
|
|
|
|
assert page.select_one("h1").text.strip() == "About your service"
|
|
|
|
|
|
assert page.select_one("input[name=name]").get("value") is None
|
2019-04-18 12:44:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_should_not_render_radios_if_org_type_known(
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request, mocker, platform_admin_user
|
2019-04-18 12:44:18 +01:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-12-20 15:02:47 +00:00
|
|
|
|
mocker.patch(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
|
|
|
|
|
return_value=organization_json(organization_type="central"),
|
2019-12-20 15:02:47 +00:00
|
|
|
|
)
|
2023-08-25 09:12:23 -07:00
|
|
|
|
page = client_request.get("main.add_service")
|
|
|
|
|
|
assert page.select_one("h1").text.strip() == "About your service"
|
|
|
|
|
|
assert page.select_one("input[name=name]").get("value") is None
|
|
|
|
|
|
assert not page.select(".multiple-choice")
|
2019-04-18 12:44:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
2020-07-01 11:18:20 +01:00
|
|
|
|
def test_show_different_page_if_user_org_type_is_local(
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request, mocker, platform_admin_user
|
2020-07-01 11:18:20 +01:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2020-07-01 11:18:20 +01:00
|
|
|
|
mocker.patch(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
|
|
|
|
|
return_value=organization_json(organization_type="local"),
|
|
|
|
|
|
)
|
|
|
|
|
|
page = client_request.get("main.add_service")
|
|
|
|
|
|
assert page.select_one("h1").text.strip() == "About your service"
|
|
|
|
|
|
assert page.select_one("input[name=name]").get("value") is None
|
|
|
|
|
|
assert page.select_one("main .usa-body").text.strip() == (
|
|
|
|
|
|
"Give your service a name that tells users what your "
|
|
|
|
|
|
"messages are about, as well as who they’re from. For example:"
|
2020-07-01 11:18:20 +01:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
|
"email_address",
|
2023-09-25 17:55:42 -04:00
|
|
|
|
[
|
2023-08-25 09:12:23 -07:00
|
|
|
|
# User’s email address doesn’t matter when the organization is known
|
|
|
|
|
|
"test@example.gsa.gov",
|
|
|
|
|
|
"test@anotherexample.gsa.gov",
|
2023-09-25 17:55:42 -04:00
|
|
|
|
],
|
2023-08-25 09:12:23 -07:00
|
|
|
|
)
|
|
|
|
|
|
@pytest.mark.parametrize(
|
2023-09-25 17:55:42 -04:00
|
|
|
|
("inherited", "posted", "persisted", "sms_limit"),
|
|
|
|
|
|
[
|
2023-08-25 09:12:23 -07:00
|
|
|
|
(None, "federal", "federal", 150_000),
|
|
|
|
|
|
# ('federal', None, 'federal', 150_000),
|
2023-09-25 17:55:42 -04:00
|
|
|
|
],
|
2023-08-25 09:12:23 -07: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,
|
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,
|
2023-10-23 14:41:31 -07:00
|
|
|
|
platform_admin_user,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2023-08-25 09:12:23 -07:00
|
|
|
|
api_user_active["email_address"] = email_address
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-12-20 15:02:47 +00:00
|
|
|
|
mocker.patch(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
2023-07-12 12:09:44 -04:00
|
|
|
|
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(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_data={
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"name": "testing the post",
|
|
|
|
|
|
"organization_type": posted,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
},
|
|
|
|
|
|
_expected_status=302,
|
|
|
|
|
|
_expected_redirect=url_for(
|
2023-08-25 09:12:23 -07: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(
|
2023-08-25 09:12:23 -07: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,
|
2023-08-25 09:12:23 -07:00
|
|
|
|
user_id=api_user_active["id"],
|
|
|
|
|
|
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(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"Example text message template",
|
|
|
|
|
|
"sms",
|
2017-03-09 10:30:19 +00:00
|
|
|
|
(
|
2023-07-28 11:12:46 -04:00
|
|
|
|
"Hi, I’m trying out Notify.gov. 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:
|
2023-08-25 09:12:23 -07:00
|
|
|
|
assert session["service_id"] == 101
|
2015-12-15 10:17:43 +00: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,
|
2023-10-23 14:41:31 -07:00
|
|
|
|
platform_admin_user,
|
2019-05-15 16:16:23 +01:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-05-15 16:16:23 +01:00
|
|
|
|
mocker.patch(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
2019-05-15 16:16:23 +01:00
|
|
|
|
return_value=None,
|
|
|
|
|
|
)
|
2023-09-19 14:30:32 -07:00
|
|
|
|
client_request.post(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2019-05-15 16:16:23 +01:00
|
|
|
|
_data={
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"name": "testing the post",
|
2019-05-15 16:16:23 +01:00
|
|
|
|
},
|
2023-09-19 14:30:32 -07:00
|
|
|
|
_expected_status=302,
|
2019-05-15 16:16:23 +01:00
|
|
|
|
)
|
2023-09-19 14:30:32 -07:00
|
|
|
|
assert mock_create_service.called is True
|
|
|
|
|
|
assert mock_create_service_template.called is True
|
2019-05-15 16:16:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
|
"email_address",
|
2023-09-25 17:55:42 -04:00
|
|
|
|
[
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"test@nhs.net",
|
|
|
|
|
|
"test@nhs.uk",
|
|
|
|
|
|
"test@example.NhS.uK",
|
|
|
|
|
|
"test@EXAMPLE.NHS.NET",
|
2023-09-25 17:55:42 -04:00
|
|
|
|
],
|
2023-08-25 09:12:23 -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,
|
|
|
|
|
|
):
|
2023-08-25 09:12:23 -07: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-08-25 09:12:23 -07:00
|
|
|
|
"app.organizations_client.get_organization_by_domain",
|
2019-05-07 10:31:16 +01:00
|
|
|
|
return_value=None,
|
|
|
|
|
|
)
|
2023-08-25 09:12:23 -07:00
|
|
|
|
page = client_request.get("main.add_service")
|
|
|
|
|
|
assert page.select_one("h1").text.strip() == "About your service"
|
|
|
|
|
|
assert page.select_one("input[name=name]").get("value") is None
|
2023-08-28 12:12:21 -04:00
|
|
|
|
assert [label.text.strip() for label in page.select(".usa-radio label")] == [
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"NHS – central government agency or public body",
|
|
|
|
|
|
"NHS Trust or Clinical Commissioning Group",
|
|
|
|
|
|
"GP practice",
|
2019-07-16 15:37:27 +01:00
|
|
|
|
]
|
2023-08-28 12:12:21 -04:00
|
|
|
|
assert [radio["value"] for radio in page.select(".usa-radio input")] == [
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"nhs_central",
|
|
|
|
|
|
"nhs_local",
|
|
|
|
|
|
"nhs_gp",
|
2019-07-16 15:37:27 +01:00
|
|
|
|
]
|
2019-05-07 10:31:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
@pytest.mark.parametrize(
|
2023-09-25 17:55:42 -04:00
|
|
|
|
("organization_type", "free_allowance"),
|
2023-08-25 09:12:23 -07:00
|
|
|
|
[
|
|
|
|
|
|
("federal", 150_000),
|
|
|
|
|
|
("state", 150_000),
|
|
|
|
|
|
],
|
|
|
|
|
|
)
|
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,
|
2023-10-23 14:41:31 -07:00
|
|
|
|
platform_admin_user,
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
client_request.post(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_data={
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"name": "testing the post",
|
|
|
|
|
|
"organization_type": organization_type,
|
2019-03-26 12:35:32 +00:00
|
|
|
|
},
|
|
|
|
|
|
_expected_status=302,
|
|
|
|
|
|
_expected_redirect=url_for(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.service_dashboard",
|
2019-03-26 12:35:32 +00:00
|
|
|
|
service_id=101,
|
2023-08-25 09:12:23 -07:00
|
|
|
|
),
|
2017-10-04 11:49:32 +01:00
|
|
|
|
)
|
2017-02-03 12:07:21 +00:00
|
|
|
|
assert mock_get_services.called
|
2016-04-28 16:44:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
@pytest.mark.parametrize(
|
2023-09-25 17:55:42 -04:00
|
|
|
|
("name", "error_message"),
|
2023-08-25 09:12:23 -07:00
|
|
|
|
[
|
|
|
|
|
|
("", "Cannot be empty"),
|
|
|
|
|
|
(".", "Must include at least two alphanumeric characters"),
|
|
|
|
|
|
("a" * 256, "Service name must be 255 characters or fewer"),
|
|
|
|
|
|
],
|
|
|
|
|
|
)
|
2020-11-30 17:08:40 +00:00
|
|
|
|
def test_add_service_fails_if_service_name_fails_validation(
|
2019-11-08 17:12:32 +00: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,
|
2023-10-23 14:41:31 -07:00
|
|
|
|
platform_admin_user,
|
2019-11-08 17:12:32 +00:00
|
|
|
|
):
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-11-08 17:12:32 +00:00
|
|
|
|
page = client_request.post(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2020-11-30 17:08:40 +00:00
|
|
|
|
_data={"name": name},
|
2019-11-08 17:12: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(
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request, mock_get_organization_by_domain, mocker, platform_admin_user
|
2017-02-03 10:42:01 +00:00
|
|
|
|
):
|
2021-02-15 11:41:26 +00:00
|
|
|
|
def _create(**_kwargs):
|
2023-08-25 09:12:23 -07:00
|
|
|
|
json_mock = mocker.Mock(
|
|
|
|
|
|
return_value={"message": {"name": ["Duplicate service name"]}}
|
|
|
|
|
|
)
|
2021-02-15 11:41:26 +00:00
|
|
|
|
resp_mock = mocker.Mock(status_code=400, json=json_mock)
|
|
|
|
|
|
http_error = HTTPError(response=resp_mock, message="Default message")
|
|
|
|
|
|
raise http_error
|
|
|
|
|
|
|
2023-08-25 09:12:23 -07:00
|
|
|
|
mocker.patch("app.service_api_client.create_service", side_effect=_create)
|
2023-10-23 14:41:31 -07:00
|
|
|
|
client_request.login(platform_admin_user)
|
2019-03-26 12:35:32 +00:00
|
|
|
|
page = client_request.post(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_data={
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"name": "SERVICE ONE",
|
|
|
|
|
|
"organization_type": "federal",
|
2017-10-04 11:49:32 +01:00
|
|
|
|
},
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_expected_status=200,
|
|
|
|
|
|
)
|
2023-08-25 09:12:23 -07: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
|
|
|
|
):
|
2023-08-25 09:12:23 -07: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(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_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
|
|
|
|
):
|
2023-08-25 09:12:23 -07: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(
|
2023-08-25 09:12:23 -07:00
|
|
|
|
"main.add_service",
|
|
|
|
|
|
_data={"name": "SERVICE TWO"},
|
2019-03-26 12:35:32 +00:00
|
|
|
|
_expected_status=403,
|
|
|
|
|
|
)
|