mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-13 07:48:39 -05:00
Implement a flag that allows simulteanous job launches on job templates
This commit is contained in:
@@ -22,3 +22,16 @@ def test_job_blocking(get, post, job_template, inventory, inventory_factory):
|
||||
assert j_callback_1.is_blocked_by(j_callback_2)
|
||||
j_callback_2.limit = 'b'
|
||||
assert not j_callback_1.is_blocked_by(j_callback_2)
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_job_blocking_allow_simul(get, post, job_template, inventory):
|
||||
job_template.allow_simultaneous = True
|
||||
j1 = Job.objects.create(job_template=job_template,
|
||||
inventory=inventory)
|
||||
j2 = Job.objects.create(job_template=job_template,
|
||||
inventory=inventory)
|
||||
assert not j1.is_blocked_by(j2)
|
||||
assert not j2.is_blocked_by(j1)
|
||||
job_template.allow_simultaneous = False
|
||||
assert j1.is_blocked_by(j2)
|
||||
assert j2.is_blocked_by(j1)
|
||||
|
||||
Reference in New Issue
Block a user