mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 17:28:51 -03:30
save state
This commit is contained in:
@@ -2957,6 +2957,8 @@ class WorkflowJobTemplateNodeChildrenBaseList(WorkflowsEnforcementMixin, Enforce
|
|||||||
if parent.id == sub.id:
|
if parent.id == sub.id:
|
||||||
return {"Error": _("Cycle detected.")}
|
return {"Error": _("Cycle detected.")}
|
||||||
|
|
||||||
|
if parent.id == sub.id
|
||||||
|
|
||||||
if WorkflowJobTemplateNode.objects.filter(Q(pk=parent.id) &
|
if WorkflowJobTemplateNode.objects.filter(Q(pk=parent.id) &
|
||||||
Q(success_nodes__in=[sub.id]) |
|
Q(success_nodes__in=[sub.id]) |
|
||||||
Q(failure_nodes__in=[sub.id]) |
|
Q(failure_nodes__in=[sub.id]) |
|
||||||
|
|||||||
@@ -110,6 +110,17 @@ class TestExclusivePathEnforcement():
|
|||||||
if index != 0:
|
if index != 0:
|
||||||
assert {'Error': 'Relationship not allowed.'} == json.loads(r.content)
|
assert {'Error': 'Relationship not allowed.'} == json.loads(r.content)
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("relationship", ['success', 'failure', 'always']):
|
||||||
|
def test_existing_relationship_allowed(self, post, admin_user, n1, n2, relationship):
|
||||||
|
r = post(self.generate_url(path, n1.id),
|
||||||
|
data={'associate': True, 'id': n2.id},
|
||||||
|
user=admin_user,
|
||||||
|
expect=204)
|
||||||
|
r = post(self.generate_url(path, n1.id),
|
||||||
|
data={'associate': True, 'id': n2.id},
|
||||||
|
user=admin_user,
|
||||||
|
expect=200)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
class TestNodeCredentials:
|
class TestNodeCredentials:
|
||||||
|
|||||||
Reference in New Issue
Block a user