mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03: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:
parent
e9df4ed800
commit
ed1c667418
@ -59,7 +59,7 @@ def test_no_changing_overwrite_behavior_if_used(post, patch, organization, admin
|
||||
user=admin_user,
|
||||
expect=201
|
||||
)
|
||||
JobTemplate.objects.create(
|
||||
jt = JobTemplate.objects.create(
|
||||
name='provides branch', project_id=r1.data['id'],
|
||||
playbook='helloworld.yml',
|
||||
scm_branch='foobar'
|
||||
@ -70,9 +70,10 @@ def test_no_changing_overwrite_behavior_if_used(post, patch, organization, admin
|
||||
user=admin_user,
|
||||
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 'ids: 2' in str(r2.data['allow_override'])
|
||||
assert Project.objects.get(pk=r1.data['id']).allow_override is True
|
||||
assert 'ids: {}'.format(jt.id) in str(r2.data['allow_override'])
|
||||
assert p.allow_override is True
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user