diff --git a/awx/main/tests/functional/test_rbac_job_templates.py b/awx/main/tests/functional/test_rbac_job_templates.py index e439533f07..f775053ccc 100644 --- a/awx/main/tests/functional/test_rbac_job_templates.py +++ b/awx/main/tests/functional/test_rbac_job_templates.py @@ -11,10 +11,12 @@ from django.apps import apps @pytest.mark.django_db -def test_job_template_migration_check(deploy_jobtemplate, check_jobtemplate, user): +def test_job_template_migration_check(credential, deploy_jobtemplate, check_jobtemplate, user): admin = user('admin', is_superuser=True) joe = user('joe') + credential.deprecated_user = joe + credential.save() check_jobtemplate.project.organization.deprecated_users.add(joe) @@ -22,6 +24,7 @@ def test_job_template_migration_check(deploy_jobtemplate, check_jobtemplate, use Permission(user=joe, inventory=check_jobtemplate.inventory, project=check_jobtemplate.project, permission_type='check').save() + rbac.migrate_users(apps, None) rbac.migrate_organization(apps, None) rbac.migrate_projects(apps, None) @@ -39,10 +42,12 @@ def test_job_template_migration_check(deploy_jobtemplate, check_jobtemplate, use assert joe not in deploy_jobtemplate.execute_role @pytest.mark.django_db -def test_job_template_migration_deploy(deploy_jobtemplate, check_jobtemplate, user): +def test_job_template_migration_deploy(credential, deploy_jobtemplate, check_jobtemplate, user): admin = user('admin', is_superuser=True) joe = user('joe') + credential.deprecated_user = joe + credential.save() deploy_jobtemplate.project.organization.deprecated_users.add(joe) @@ -68,13 +73,16 @@ def test_job_template_migration_deploy(deploy_jobtemplate, check_jobtemplate, us @pytest.mark.django_db -def test_job_template_team_migration_check(deploy_jobtemplate, check_jobtemplate, organization, team, user): +def test_job_template_team_migration_check(credential, deploy_jobtemplate, check_jobtemplate, organization, team, user): admin = user('admin', is_superuser=True) joe = user('joe') team.deprecated_users.add(joe) team.organization = organization team.save() + credential.deprecated_team = team + credential.save() + check_jobtemplate.project.organization.deprecated_users.add(joe) Permission(team=team, inventory=check_jobtemplate.inventory, permission_type='read').save() @@ -101,13 +109,16 @@ def test_job_template_team_migration_check(deploy_jobtemplate, check_jobtemplate @pytest.mark.django_db -def test_job_template_team_deploy_migration(deploy_jobtemplate, check_jobtemplate, organization, team, user): +def test_job_template_team_deploy_migration(credential, deploy_jobtemplate, check_jobtemplate, organization, team, user): admin = user('admin', is_superuser=True) joe = user('joe') team.deprecated_users.add(joe) team.organization = organization team.save() + credential.deprecated_team = team + credential.save() + deploy_jobtemplate.project.organization.deprecated_users.add(joe) Permission(team=team, inventory=deploy_jobtemplate.inventory, permission_type='read').save()