From 475cac044b17a625bab2078da79697babe9f3c9c Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 4 May 2015 08:01:18 -0400 Subject: [PATCH] job launch tests --- awx/main/tests/jobs/job_launch.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/awx/main/tests/jobs/job_launch.py b/awx/main/tests/jobs/job_launch.py index 26124b1f61..7d078e88bb 100644 --- a/awx/main/tests/jobs/job_launch.py +++ b/awx/main/tests/jobs/job_launch.py @@ -148,6 +148,18 @@ class JobTemplateLaunchTest(BaseJobTestMixin, django.test.TestCase): with self.current_user(self.user_sue): self.post(self.launch_url, {}, expect=400) + # pass in a credential NOT viewable by the current logged in user + def test_explicit_credential_permission_denied(self): + #self.cred_sue.mark_inactive() + with self.current_user(self.user_doug): + self.post(self.launch_url, {'credential': self.cred_sue.pk}, expect=403) + + def test_explicit_deleted_credential(self): + self.cred_sue.mark_inactive() + with self.current_user(self.user_alex): + self.post(self.launch_url, {'credential': self.cred_sue.pk}, expect=400) + + class JobTemplateLaunchPasswordsTest(BaseJobTestMixin, django.test.TestCase): def setUp(self): super(JobTemplateLaunchPasswordsTest, self).setUp()