From ed1c667418ce573a0d5b33a00c6dfb61d3bfad5b Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Tue, 20 Aug 2019 14:12:10 -0400 Subject: [PATCH] Fix asserts in test_project.py to use the id directly off of the job template test_no_changing_overwrite_behavior_if_used, specifically. --- awx/main/tests/functional/api/test_project.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/main/tests/functional/api/test_project.py b/awx/main/tests/functional/api/test_project.py index 571d0624fb..af46363557 100644 --- a/awx/main/tests/functional/api/test_project.py +++ b/awx/main/tests/functional/api/test_project.py @@ -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