mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
add test for launching with deleted inventory
This commit is contained in:
committed by
Jake McDermott
parent
a60401abb9
commit
eb58a6cc0e
@@ -6,7 +6,7 @@ import pytest
|
|||||||
# AWX
|
# AWX
|
||||||
from awx.api.serializers import JobTemplateSerializer
|
from awx.api.serializers import JobTemplateSerializer
|
||||||
from awx.api.versioning import reverse
|
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
|
from awx.main.migrations import _save_password_keys as save_password_keys
|
||||||
|
|
||||||
# Django
|
# 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.']
|
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
|
@pytest.mark.django_db
|
||||||
def test_launch_with_extra_credentials(get, post, organization_factory,
|
def test_launch_with_extra_credentials(get, post, organization_factory,
|
||||||
job_template_factory, machine_credential,
|
job_template_factory, machine_credential,
|
||||||
|
|||||||
Reference in New Issue
Block a user