Skip to content

Commit

Permalink
Fix the API test to that it covers changing the job_type to the oppos…
Browse files Browse the repository at this point in the history
…ite value
  • Loading branch information
Sasa Jovicic authored and Sasa993 committed Jan 14, 2025
1 parent b0360b3 commit dc2fa0e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion awx/main/tests/functional/api/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ def test_job_relaunch_with_job_type(post, inventory, project, machine_credential
# Create a job template
jt = JobTemplate.objects.create(name='testjt', inventory=inventory, project=project)

# Set initial job type
init_job_type = 'check' if job_type == 'run' else 'run'

# Create a job instance
job = jt.create_unified_job()
job = jt.create_unified_job(_eager_fields={'job_type': init_job_type})

# Perform the POST request
url = reverse('api:job_relaunch', kwargs={'pk': job.pk})
Expand Down

0 comments on commit dc2fa0e

Please sign in to comment.