allow relaunching other user jobs with public vars

This commit is contained in:
AlanCoding
2019-04-29 20:38:36 -04:00
parent aaeb2d6fb9
commit 5720601a2e
4 changed files with 44 additions and 10 deletions

View File

@@ -11,6 +11,7 @@ from awx.main.access import (
JobTemplateAccess,
WorkflowJobTemplateAccess,
SystemJobTemplateAccess,
vars_are_encrypted
)
from awx.main.models import (
@@ -114,6 +115,20 @@ class TestRelatedFieldAccess:
'related', mocker.MagicMock, data, obj=resource, mandatory=True)
def test_encrypted_vars_detection():
assert vars_are_encrypted({
'aaa': {'b': 'c'},
'alist': [],
'test_var_eight': '$encrypted$UTF8$AESCBC$Z0FBQUF...==',
'test_var_five': 'four',
})
assert not vars_are_encrypted({
'aaa': {'b': 'c'},
'alist': [],
'test_var_five': 'four',
})
@pytest.fixture
def job_template_with_ids(job_template_factory):
# Create non-persisted objects with IDs to send to job_template_factory