mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
Merge pull request #7095 from AlanCoding/schedule_validation
Add various validation for schedule extra_data
This commit is contained in:
12
awx/main/tests/functional/api/test_schedules.py
Normal file
12
awx/main/tests/functional/api/test_schedules.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_non_job_extra_vars_prohibited(post, project, admin_user):
|
||||
rrule = 'DTSTART:20151117T050000Z RRULE:FREQ=DAILY;INTERVAL=1;COUNT=1'
|
||||
url = reverse('api:project_schedules_list', kwargs={'pk': project.id})
|
||||
r = post(url, {'name': 'test sch', 'rrule': rrule, 'extra_data': '{"a": 5}'},
|
||||
admin_user, expect=400)
|
||||
assert 'cannot accept extra variables' in r.data['extra_data'][0]
|
||||
Reference in New Issue
Block a user