mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 11:55:04 -02:30
Last of the ad-hoc priv escalation unit test fixes
This commit is contained in:
@@ -568,17 +568,10 @@ class AdHocCommandApiTest(BaseAdHocCommandTest):
|
|||||||
with self.current_user('admin'):
|
with self.current_user('admin'):
|
||||||
response = self.post(url, data, expect=400)
|
response = self.post(url, data, expect=400)
|
||||||
data.pop('forks')
|
data.pop('forks')
|
||||||
data['privilege_escalation'] = 'telekinesis'
|
data['become_enabled'] = True
|
||||||
with self.current_user('admin'):
|
|
||||||
response = self.post(url, data, expect=400)
|
|
||||||
data['privilege_escalation'] = 'su'
|
|
||||||
with self.current_user('admin'):
|
with self.current_user('admin'):
|
||||||
response = self.post(url, data, expect=201)
|
response = self.post(url, data, expect=201)
|
||||||
self.assertEqual(response['privilege_escalation'], 'su')
|
self.assertEqual(response['become_enabled'], True)
|
||||||
data['privilege_escalation'] = 'sudo'
|
|
||||||
with self.current_user('admin'):
|
|
||||||
response = self.post(url, data, expect=201)
|
|
||||||
self.assertEqual(response['privilege_escalation'], 'sudo')
|
|
||||||
|
|
||||||
def test_ad_hoc_command_detail(self):
|
def test_ad_hoc_command_detail(self):
|
||||||
# Post to list to start a new ad hoc command.
|
# Post to list to start a new ad hoc command.
|
||||||
|
|||||||
Reference in New Issue
Block a user