mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 18:37:36 -02:30
flake8
This commit is contained in:
@@ -7,11 +7,9 @@ from __future__ import absolute_import
|
|||||||
# Django
|
# Django
|
||||||
import django
|
import django
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import * # noqa
|
from awx.main.models import * # noqa
|
||||||
from awx.main.tests.base import BaseLiveServerTest
|
|
||||||
from .base import BaseJobTestMixin
|
from .base import BaseJobTestMixin
|
||||||
|
|
||||||
__all__ = ['JobTemplateLaunchTest', 'JobTemplateLaunchPasswordsTest']
|
__all__ = ['JobTemplateLaunchTest', 'JobTemplateLaunchPasswordsTest']
|
||||||
@@ -111,14 +109,14 @@ class JobTemplateLaunchTest(BaseJobTestMixin, django.test.TestCase):
|
|||||||
# pass an invalid/inactive credential value).
|
# pass an invalid/inactive credential value).
|
||||||
with self.current_user(self.user_sue):
|
with self.current_user(self.user_sue):
|
||||||
self.cred_sue.mark_inactive()
|
self.cred_sue.mark_inactive()
|
||||||
response = self.post(self.launch_url, {}, expect=400)
|
self.post(self.launch_url, {}, expect=400)
|
||||||
response = self.post(self.launch_url, {'credential': 0}, expect=400)
|
self.post(self.launch_url, {'credential': 0}, expect=400)
|
||||||
response = self.post(self.launch_url, {'credential_id': 0}, expect=400)
|
self.post(self.launch_url, {'credential_id': 0}, expect=400)
|
||||||
response = self.post(self.launch_url, {'credential': 'one'}, expect=400)
|
self.post(self.launch_url, {'credential': 'one'}, expect=400)
|
||||||
response = self.post(self.launch_url, {'credential_id': 'one'}, expect=400)
|
self.post(self.launch_url, {'credential_id': 'one'}, expect=400)
|
||||||
self.cred_doug.mark_inactive()
|
self.cred_doug.mark_inactive()
|
||||||
response = self.post(self.launch_url, {'credential': self.cred_doug.pk}, expect=400)
|
self.post(self.launch_url, {'credential': self.cred_doug.pk}, expect=400)
|
||||||
response = self.post(self.launch_url, {'credential_id': self.cred_doug.pk}, expect=400)
|
self.post(self.launch_url, {'credential_id': self.cred_doug.pk}, expect=400)
|
||||||
|
|
||||||
def test_no_project_fail(self):
|
def test_no_project_fail(self):
|
||||||
# Job Templates without projects can not be launched
|
# Job Templates without projects can not be launched
|
||||||
@@ -148,7 +146,7 @@ class JobTemplateLaunchTest(BaseJobTestMixin, django.test.TestCase):
|
|||||||
# Job Templates with deleted credentials cannot be launched.
|
# Job Templates with deleted credentials cannot be launched.
|
||||||
self.cred_sue.mark_inactive()
|
self.cred_sue.mark_inactive()
|
||||||
with self.current_user(self.user_sue):
|
with self.current_user(self.user_sue):
|
||||||
response = self.post(self.launch_url, {}, expect=400)
|
self.post(self.launch_url, {}, expect=400)
|
||||||
|
|
||||||
class JobTemplateLaunchPasswordsTest(BaseJobTestMixin, django.test.TestCase):
|
class JobTemplateLaunchPasswordsTest(BaseJobTestMixin, django.test.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user