mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-15 02:58:36 -05:00
fix tests with refreshes
This commit is contained in:
@@ -118,6 +118,9 @@ def test_cred_job_template(user, team, deploy_jobtemplate):
|
||||
|
||||
access = CredentialAccess(a)
|
||||
rbac.migrate_credential(apps, None)
|
||||
|
||||
cred.refresh_from_db()
|
||||
|
||||
assert access.can_change(cred, {'organization': org.pk})
|
||||
|
||||
org.admin_role.members.remove(a)
|
||||
@@ -135,6 +138,8 @@ def test_cred_multi_job_template_single_org_xfail(user, deploy_jobtemplate):
|
||||
|
||||
access = CredentialAccess(a)
|
||||
rbac.migrate_credential(apps, None)
|
||||
cred.refresh_from_db()
|
||||
|
||||
assert not access.can_change(cred, {'organization': org.pk})
|
||||
|
||||
@pytest.mark.django_db
|
||||
@@ -149,6 +154,8 @@ def test_cred_multi_job_template_single_org(user, team, deploy_jobtemplate):
|
||||
|
||||
access = CredentialAccess(a)
|
||||
rbac.migrate_credential(apps, None)
|
||||
cred.refresh_from_db()
|
||||
|
||||
assert access.can_change(cred, {'organization': org.pk})
|
||||
|
||||
org.admin_role.members.remove(a)
|
||||
@@ -180,6 +187,7 @@ def test_single_cred_multi_job_template_multi_org(user, organizations, credentia
|
||||
|
||||
for jt in jts:
|
||||
jt.refresh_from_db()
|
||||
credential.refresh_from_db()
|
||||
|
||||
assert jts[0].credential != jts[1].credential
|
||||
assert access.can_change(jts[0].credential, {'organization': org.pk})
|
||||
|
||||
Reference in New Issue
Block a user