mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 16:37:30 -02:30
Scan jobs have been removed, clean up old refs
see https://github.com/ansible/awx/issues/5603
This commit is contained in:
@@ -264,18 +264,6 @@ def test_job_launch_fails_without_credential_access(job_template_prompts, runtim
|
||||
dict(credentials=runtime_data['credentials']), rando, expect=403)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@pytest.mark.job_runtime_vars
|
||||
def test_job_block_scan_job_type_change(job_template_prompts, post, admin_user):
|
||||
job_template = job_template_prompts(True)
|
||||
|
||||
# Assure that changing the type of a scan job blocks the launch
|
||||
response = post(reverse('api:job_template_launch', kwargs={'pk':job_template.pk}),
|
||||
dict(job_type='scan'), admin_user, expect=400)
|
||||
|
||||
assert 'job_type' in response.data
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_job_launch_JT_with_validation(machine_credential, credential, deploy_jobtemplate):
|
||||
deploy_jobtemplate.extra_vars = '{"job_template_var": 3}'
|
||||
|
||||
@@ -197,36 +197,6 @@ def test_change_jt_sensitive_data(job_template_with_ids, mocker, user_unit):
|
||||
})
|
||||
|
||||
|
||||
def test_jt_add_scan_job_check(job_template_with_ids, user_unit):
|
||||
"Assure that permissions to add scan jobs work correctly"
|
||||
|
||||
access = JobTemplateAccess(user_unit)
|
||||
project = job_template_with_ids.project
|
||||
inventory = job_template_with_ids.inventory
|
||||
project.use_role = Role()
|
||||
inventory.use_role = Role()
|
||||
organization = Organization(name='test-org')
|
||||
inventory.organization = organization
|
||||
organization.admin_role = Role()
|
||||
|
||||
def mock_get_object(Class, **kwargs):
|
||||
if Class == Project:
|
||||
return project
|
||||
elif Class == Inventory:
|
||||
return inventory
|
||||
else:
|
||||
raise Exception('Item requested has not been mocked')
|
||||
|
||||
|
||||
with mock.patch('awx.main.models.rbac.Role.__contains__', return_value=True):
|
||||
with mock.patch('awx.main.access.get_object_or_400', mock_get_object):
|
||||
assert access.can_add({
|
||||
'project': project.pk,
|
||||
'inventory': inventory.pk,
|
||||
'job_type': 'scan'
|
||||
})
|
||||
|
||||
|
||||
def mock_raise_none(self, add_host=False, feature=None, check_expiration=True):
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user