mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 17:39:13 -04:00
Merge branch 'main' of https://github.com/GSA/notifications-admin into notify-786
This commit is contained in:
@@ -39,28 +39,12 @@ from tests.conftest import (
|
||||
),
|
||||
(
|
||||
create_active_user_empty_permissions(),
|
||||
(
|
||||
"Test User With Empty Permissions (you) "
|
||||
"Permissions "
|
||||
"Cannot See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
),
|
||||
("Test User With Empty Permissions (you) " "Permissions"),
|
||||
False,
|
||||
),
|
||||
(
|
||||
create_active_user_view_permissions(),
|
||||
(
|
||||
"Test User With Permissions (you) "
|
||||
"Permissions "
|
||||
"Can See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
),
|
||||
("Test User With Permissions (you) " "Permissions " "Can See dashboard"),
|
||||
False,
|
||||
),
|
||||
(
|
||||
@@ -69,10 +53,7 @@ from tests.conftest import (
|
||||
"Test User With Permissions (you) "
|
||||
"Permissions "
|
||||
"Can See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Can Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
"Can Add and edit templates"
|
||||
),
|
||||
False,
|
||||
),
|
||||
@@ -112,15 +93,7 @@ def test_should_show_overview_page(
|
||||
normalize_spaces(page.select(".user-list-item")[0].text) == expected_self_text
|
||||
)
|
||||
|
||||
expected = (
|
||||
"ZZZZZZZZ zzzzzzz@example.gsa.gov "
|
||||
"Permissions "
|
||||
"Can See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
)
|
||||
expected = "ZZZZZZZZ zzzzzzz@example.gsa.gov " "Permissions " "Can See dashboard"
|
||||
|
||||
if add_details is True:
|
||||
expected = f"{expected} Change details for ZZZZZZZZ zzzzzzz@example.gsa.gov"
|
||||
@@ -259,23 +232,11 @@ def test_should_show_caseworker_on_overview_page(
|
||||
|
||||
assert normalize_spaces(page.select_one("h1").text) == "Team members"
|
||||
assert normalize_spaces(page.select(".user-list-item")[0].text) == (
|
||||
"Test User With Permissions (you) "
|
||||
"Permissions "
|
||||
"Can See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
"Test User With Permissions (you) " "Permissions " "Can See dashboard"
|
||||
)
|
||||
# [1:5] are invited users
|
||||
assert normalize_spaces(page.select(".user-list-item")[6].text) == (
|
||||
"Test User zzzzzzz@example.gsa.gov "
|
||||
"Permissions "
|
||||
"Cannot See dashboard "
|
||||
"Can Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
"Test User zzzzzzz@example.gsa.gov " "Permissions " "Can Send messages"
|
||||
)
|
||||
|
||||
|
||||
@@ -1240,7 +1201,6 @@ def test_cancel_invited_user_doesnt_work_if_user_not_invited_to_this_service(
|
||||
"Permissions "
|
||||
"Can See dashboard "
|
||||
"Can Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Can Manage settings, team and usage "
|
||||
"Can Manage API integration "
|
||||
"Cancel invitation for invited_user@test.gsa.gov"
|
||||
@@ -1250,13 +1210,8 @@ def test_cancel_invited_user_doesnt_work_if_user_not_invited_to_this_service(
|
||||
"cancelled",
|
||||
(
|
||||
"invited_user@test.gsa.gov (cancelled invite) "
|
||||
"Permissions "
|
||||
"Permissions"
|
||||
# all permissions are greyed out
|
||||
"Cannot See dashboard "
|
||||
"Cannot Send messages "
|
||||
"Cannot Add and edit templates "
|
||||
"Cannot Manage settings, team and usage "
|
||||
"Cannot Manage API integration"
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@ import pytest
|
||||
from flask import url_for
|
||||
|
||||
from app.models.user import User
|
||||
from tests.conftest import SERVICE_ONE_ID, create_platform_admin_user, normalize_spaces
|
||||
from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
||||
|
||||
|
||||
def test_render_sign_in_template_for_new_user(client_request):
|
||||
@@ -72,19 +72,6 @@ def test_doesnt_redirect_to_sign_in_if_no_session_info(
|
||||
with client_request.session_transaction() as session:
|
||||
session["current_session_id"] = None
|
||||
|
||||
# This returns a 403 now
|
||||
with pytest.raises(AssertionError):
|
||||
client_request.get("main.add_service")
|
||||
|
||||
|
||||
def test_doesnt_redirect_to_sign_in_if_no_session_info_platform_admin(
|
||||
client_request,
|
||||
mock_get_organization_by_domain,
|
||||
):
|
||||
platform_admin = create_platform_admin_user()
|
||||
client_request.login(platform_admin)
|
||||
platform_admin["current_session_id"] = str(uuid.UUID(int=1))
|
||||
|
||||
with client_request.session_transaction() as session:
|
||||
session["current_session_id"] = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user