mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Finally finished linting all the tests!
...Now to fix the ones I broke... :lolsob: Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -9,15 +9,15 @@ from tests.conftest import ORGANISATION_ID, SERVICE_ONE_ID, normalize_spaces
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"organization_type, expected_options",
|
||||
(
|
||||
("organization_type", "expected_options"),
|
||||
[
|
||||
(
|
||||
"other",
|
||||
[
|
||||
("something_else", "Something else"),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_email_branding_request_page_when_no_branding_is_set(
|
||||
service_one,
|
||||
@@ -86,8 +86,8 @@ def test_email_branding_request_page_back_link(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"data, org_type, endpoint",
|
||||
(
|
||||
("data", "org_type", "endpoint"),
|
||||
[
|
||||
(
|
||||
{
|
||||
"options": "govuk",
|
||||
@@ -109,7 +109,7 @@ def test_email_branding_request_page_back_link(
|
||||
"federal",
|
||||
"main.email_branding_something_else",
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_email_branding_request_submit(
|
||||
client_request,
|
||||
@@ -162,7 +162,7 @@ def test_email_branding_request_submit_when_no_radio_button_is_selected(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"endpoint, expected_heading",
|
||||
("endpoint", "expected_heading"),
|
||||
[
|
||||
("main.email_branding_govuk_and_org", "Before you request new branding"),
|
||||
],
|
||||
@@ -196,11 +196,8 @@ def test_email_branding_description_pages_for_org_branding(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"endpoint, service_org_type, branding_preview_id",
|
||||
[
|
||||
("main.email_branding_govuk", "central", "__NONE__"),
|
||||
# ('main.email_branding_nhs', 'nhs_local', NHS_EMAIL_BRANDING_ID),
|
||||
],
|
||||
("endpoint", "service_org_type", "branding_preview_id"),
|
||||
[("main.email_branding_govuk", "central", "__NONE__")],
|
||||
)
|
||||
@pytest.mark.skip(reason="Update for TTS")
|
||||
def test_email_branding_govuk_and_nhs_pages(
|
||||
|
||||
@@ -7,7 +7,7 @@ from app.main.views.service_settings import PLATFORM_ADMIN_SERVICE_PERMISSIONS
|
||||
from tests.conftest import normalize_spaces
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def get_service_settings_page(
|
||||
client_request,
|
||||
platform_admin_user,
|
||||
@@ -41,7 +41,7 @@ def test_service_set_permission_requires_platform_admin(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"initial_permissions, permission, form_data, expected_update",
|
||||
("initial_permissions", "permission", "form_data", "expected_update"),
|
||||
[
|
||||
(
|
||||
[],
|
||||
@@ -102,7 +102,7 @@ def test_service_set_permission(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_fields, endpoint, kwargs, text",
|
||||
("service_fields", "endpoint", "kwargs", "text"),
|
||||
[
|
||||
(
|
||||
{"restricted": True},
|
||||
@@ -146,7 +146,7 @@ def test_service_setting_toggles_show(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_fields, endpoint, index, text",
|
||||
("service_fields", "endpoint", "index", "text"),
|
||||
[
|
||||
({"active": True}, ".archive_service", 0, "Delete this service"),
|
||||
({"active": True}, ".suspend_service", 1, "Suspend service"),
|
||||
@@ -172,7 +172,7 @@ def test_service_setting_link_toggles(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_fields, endpoint, index, text",
|
||||
("service_fields", "endpoint", "index", "text"),
|
||||
[
|
||||
pytest.param(
|
||||
{"active": False},
|
||||
@@ -190,7 +190,9 @@ def test_service_setting_link_toggles_index_error(
|
||||
index,
|
||||
text,
|
||||
):
|
||||
with pytest.raises(expected_exception=IndexError):
|
||||
with pytest.raises( # noqa: PT012 # Requires more research to refactor.
|
||||
expected_exception=IndexError
|
||||
):
|
||||
url_for(endpoint, service_id=service_one["id"])
|
||||
service_one.update(service_fields)
|
||||
page = get_service_settings_page()
|
||||
@@ -198,7 +200,7 @@ def test_service_setting_link_toggles_index_error(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"permissions,permissions_text,visible",
|
||||
("permissions", "permissions_text,visible"),
|
||||
[
|
||||
("sms", "inbound SMS", True),
|
||||
("inbound_sms", "inbound SMS", False), # no sms parent permission
|
||||
@@ -216,7 +218,7 @@ def test_service_settings_doesnt_show_option_if_parent_permission_disabled(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_fields, link_text",
|
||||
("service_fields", "link_text"),
|
||||
[
|
||||
# can't archive or suspend inactive service. Can't resume active service.
|
||||
({"active": False}, "Archive service"),
|
||||
|
||||
Reference in New Issue
Block a user