mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Fix asserts in test_project.py to use the id directly off of the job template
test_no_changing_overwrite_behavior_if_used, specifically.
This commit is contained in:
@@ -59,7 +59,7 @@ def test_no_changing_overwrite_behavior_if_used(post, patch, organization, admin
|
|||||||
user=admin_user,
|
user=admin_user,
|
||||||
expect=201
|
expect=201
|
||||||
)
|
)
|
||||||
JobTemplate.objects.create(
|
jt = JobTemplate.objects.create(
|
||||||
name='provides branch', project_id=r1.data['id'],
|
name='provides branch', project_id=r1.data['id'],
|
||||||
playbook='helloworld.yml',
|
playbook='helloworld.yml',
|
||||||
scm_branch='foobar'
|
scm_branch='foobar'
|
||||||
@@ -70,9 +70,10 @@ def test_no_changing_overwrite_behavior_if_used(post, patch, organization, admin
|
|||||||
user=admin_user,
|
user=admin_user,
|
||||||
expect=400
|
expect=400
|
||||||
)
|
)
|
||||||
|
p = Project.objects.get(pk=r1.data['id'])
|
||||||
assert 'job templates depend on branch override behavior for this project' in str(r2.data['allow_override'])
|
assert 'job templates depend on branch override behavior for this project' in str(r2.data['allow_override'])
|
||||||
assert 'ids: 2' in str(r2.data['allow_override'])
|
assert 'ids: {}'.format(jt.id) in str(r2.data['allow_override'])
|
||||||
assert Project.objects.get(pk=r1.data['id']).allow_override is True
|
assert p.allow_override is True
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
|
|||||||
Reference in New Issue
Block a user