From 73dc0617166fc3e98f382decda04e4c03998cf11 Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Tue, 1 Mar 2016 09:47:26 -0500 Subject: [PATCH] Patch up our credential migration tests to undo some automatic work that needs to be done in the migration --- awx/main/tests/functional/test_rbac_credential.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/functional/test_rbac_credential.py b/awx/main/tests/functional/test_rbac_credential.py index 2e44442528..e2febb456d 100644 --- a/awx/main/tests/functional/test_rbac_credential.py +++ b/awx/main/tests/functional/test_rbac_credential.py @@ -30,7 +30,10 @@ def test_credential_migration_team_member(credential, team, user, permissions): credential.team = team credential.save() - # No permissions pre-migration + + # No permissions pre-migration (this happens automatically so we patch this) + team.admin_role.children.remove(credential.owner_role) + team.member_role.children.remove(credential.usage_role) assert not credential.accessible_by(u, permissions['admin']) migrated = rbac.migrate_credential(apps, None) @@ -47,6 +50,8 @@ def test_credential_migration_team_admin(credential, team, user, permissions): credential.save() # No permissions pre-migration + team.admin_role.children.remove(credential.owner_role) + team.member_role.children.remove(credential.usage_role) assert not credential.accessible_by(u, permissions['usage']) # Usage permissions post migration