mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
add test for launching with deleted inventory
This commit is contained in:
parent
a60401abb9
commit
eb58a6cc0e
@ -6,7 +6,7 @@ import pytest
|
||||
# AWX
|
||||
from awx.api.serializers import JobTemplateSerializer
|
||||
from awx.api.versioning import reverse
|
||||
from awx.main.models import Job, JobTemplate, CredentialType
|
||||
from awx.main.models import Job, JobTemplate, CredentialType, WorkflowJobTemplate
|
||||
from awx.main.migrations import _save_password_keys as save_password_keys
|
||||
|
||||
# Django
|
||||
@ -519,6 +519,24 @@ def test_launch_with_pending_deletion_inventory(get, post, organization_factory,
|
||||
assert resp.data['inventory'] == ['The inventory associated with this Job Template is being deleted.']
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_launch_with_pending_deletion_inventory_workflow(get, post, organization, inventory, admin_user):
|
||||
wfjt = WorkflowJobTemplate.objects.create(
|
||||
name='wfjt',
|
||||
organization=organization,
|
||||
inventory=inventory
|
||||
)
|
||||
|
||||
inventory.pending_deletion = True
|
||||
inventory.save()
|
||||
|
||||
resp = post(
|
||||
url=reverse('api:workflow_job_template_launch', kwargs={'pk': wfjt.pk}),
|
||||
user=admin_user, expect=400
|
||||
)
|
||||
assert resp.data['inventory'] == ['The inventory associated with this Workflow is being deleted.']
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_launch_with_extra_credentials(get, post, organization_factory,
|
||||
job_template_factory, machine_credential,
|
||||
|
Loading…
Reference in New Issue
Block a user