Update form to handle No access
This commit is contained in:
@@ -34,9 +34,7 @@ def test_update_env_role():
|
||||
def test_update_env_role_no_access():
|
||||
env_role = EnvironmentRoleFactory.create(role=CSPRole.BASIC_ACCESS.value)
|
||||
|
||||
assert Environments.update_env_role(
|
||||
env_role.environment, env_role.user, "No access"
|
||||
)
|
||||
assert Environments.update_env_role(env_role.environment, env_role.user, None)
|
||||
assert not EnvironmentRoles.get(env_role.user.id, env_role.environment.id)
|
||||
|
||||
|
||||
@@ -84,7 +82,7 @@ def test_update_env_roles_by_environment():
|
||||
{
|
||||
"user_id": env_role_3.user.id,
|
||||
"name": env_role_3.user.full_name,
|
||||
"role": "No access",
|
||||
"role": None,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -119,7 +117,7 @@ def test_update_env_roles_by_member():
|
||||
{"id": dev.id, "role": CSPRole.NETWORK_ADMIN.value},
|
||||
{"id": staging.id, "role": CSPRole.BUSINESS_READ.value},
|
||||
{"id": prod.id, "role": CSPRole.TECHNICAL_READ.value},
|
||||
{"id": testing.id, "role": "No access"},
|
||||
{"id": testing.id, "role": None},
|
||||
]
|
||||
|
||||
Environments.update_env_roles_by_member(user, env_roles)
|
||||
|
@@ -189,7 +189,7 @@ def test_user_with_permission_can_update_team_env_roles(client, user_session):
|
||||
"team_roles-1-role": CSPRole.BASIC_ACCESS.value,
|
||||
"team_roles-2-user_id": env_role_3.user.id,
|
||||
"team_roles-2-name": env_role_3.user.full_name,
|
||||
"team_roles-2-role": "No access",
|
||||
"team_roles-2-role": "",
|
||||
"team_roles-3-user_id": app_role.user.id,
|
||||
"team_roles-3-name": app_role.user.full_name,
|
||||
"team_roles-3-role": CSPRole.TECHNICAL_READ.value,
|
||||
@@ -227,7 +227,7 @@ def test_user_without_permission_cannot_update_team_env_roles(client, user_sessi
|
||||
"team_roles-0-role": CSPRole.NETWORK_ADMIN.value,
|
||||
"team_roles-1-user_id": env_role_2.user.id,
|
||||
"team_roles-1-name": env_role_2.user.full_name,
|
||||
"team_roles-1-role": "No access",
|
||||
"team_roles-1-role": "",
|
||||
"team_roles-2-user_id": app_role.user.id,
|
||||
"team_roles-2-name": app_role.user.full_name,
|
||||
"team_roles-2-role": CSPRole.TECHNICAL_READ.value,
|
||||
|
Reference in New Issue
Block a user