add the vault_id to the response payload on the JT launch endpoint

see: https://github.com/ansible/awx/issues/914
This commit is contained in:
Ryan Petrello
2018-01-04 15:13:48 -05:00
parent 6d413bd412
commit 60743d6ba6
2 changed files with 21 additions and 4 deletions
@@ -403,6 +403,22 @@ def test_job_launch_fails_with_missing_multivault_password(machine_credential, v
url = reverse('api:job_template_launch', kwargs={'pk': deploy_jobtemplate.pk})
resp = get(url, rando, expect=200)
assert {
'credential_type': vault_cred_first.credential_type_id,
'passwords_needed': ['vault_password.abc'],
'vault_id': u'abc',
'name': u'Vault #1',
'id': vault_cred_first.id
} in resp.data['defaults']['credentials']
assert {
'credential_type': vault_cred_second.credential_type_id,
'passwords_needed': ['vault_password.xyz'],
'vault_id': u'xyz',
'name': u'Vault #2',
'id': vault_cred_second.id
} in resp.data['defaults']['credentials']
assert resp.data['passwords_needed_to_start'] == ['vault_password.abc', 'vault_password.xyz']
assert sum([
cred['passwords_needed'] for cred in resp.data['defaults']['credentials']