mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 03:31:10 -03:30
Ability to post new job templates. The permissions checks on these need more tests for non-org-admin users.
This commit is contained in:
@@ -100,12 +100,23 @@ class JobsTest(BaseTest):
|
||||
)
|
||||
|
||||
|
||||
def test_get_list(self):
|
||||
def test_mainline(self):
|
||||
|
||||
# no credentials == 401
|
||||
# job templates
|
||||
data = self.get('/api/v1/job_templates/', expect=401)
|
||||
data = self.get('/api/v1/job_templates/', expect=200, auth=self.get_normal_credentials())
|
||||
#print data
|
||||
self.assertTrue(data['count'], 99)
|
||||
self.assertTrue(data['count'], 2)
|
||||
|
||||
rec = dict(
|
||||
name = 'job-foo',
|
||||
credential = self.credential.pk,
|
||||
inventory = self.inventory.pk,
|
||||
project = self.project.pk,
|
||||
job_type = PERM_INVENTORY_DEPLOY
|
||||
)
|
||||
posted = self.post('/api/v1/job_templates/', rec, expect=201, auth=self.get_normal_credentials())
|
||||
self.assertEquals(posted['url'], '/api/v1/job_templates/3/')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user