fix bug with relaunching with changed JT

This commit is contained in:
AlanCoding
2018-10-19 16:02:56 -04:00
parent 556040fb8b
commit 8965f1934e
4 changed files with 43 additions and 23 deletions

View File

@@ -671,6 +671,24 @@ def job_template_labels(organization, job_template):
return job_template
@pytest.fixture
def jt_linked(job_template_factory, credential, net_credential, vault_credential):
'''
A job template with a reasonably complete set of related objects to
test RBAC and other functionality affected by related objects
'''
objects = job_template_factory(
'testJT', organization='org1', project='proj1', inventory='inventory1',
credential='cred1')
jt = objects.job_template
jt.credentials.add(vault_credential)
jt.save()
# Add AWS cloud credential and network credential
jt.credentials.add(credential)
jt.credentials.add(net_credential)
return jt
@pytest.fixture
def workflow_job_template(organization):
wjt = WorkflowJobTemplate(name='test-workflow_job_template', organization=organization)