Update tests

This commit is contained in:
Montana
2019-05-02 16:15:01 -04:00
parent 1759732d38
commit 526bcb1661
6 changed files with 53 additions and 21 deletions

View File

@@ -7,20 +7,25 @@ from atst.forms.team import *
def test_permissions_form_permission_sets():
form_data = {
"perms_env_mgmt": "",
"perms_team_mgmt": PermissionSets.EDIT_APPLICATION_TEAM,
"perms_del_env": "",
"perms_env_mgmt": PermissionSets.VIEW_APPLICATION,
"perms_del_env": "View only",
}
form = PermissionsForm(data=form_data)
assert form.validate()
assert form.data == [PermissionSets.EDIT_APPLICATION_TEAM]
assert form.data == [
PermissionSets.EDIT_APPLICATION_TEAM,
PermissionSets.VIEW_APPLICATION,
"View only",
]
def test_permissions_form_invalid():
form_data = {
"perms_env_mgmt": "not a real choice",
"perms_team_mgmt": PermissionSets.EDIT_APPLICATION_TEAM,
"perms_del_env": "",
"perms_env_mgmt": "not a real choice",
"perms_del_env": "View only",
}
form = PermissionsForm(data=form_data)
assert not form.validate()