mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 13:57:39 -02:30
Merge pull request #194 from chrismeyersfsu/feature-unit_test_speedup
speedup each test case by .3 seconds
This commit is contained in:
@@ -88,7 +88,7 @@ class QueueStartStopTestMixin(QueueTestMixin):
|
|||||||
super(QueueStartStopTestMixin, self).tearDown()
|
super(QueueStartStopTestMixin, self).tearDown()
|
||||||
self.terminate_queue()
|
self.terminate_queue()
|
||||||
|
|
||||||
|
ansible_version = get_ansible_version()
|
||||||
class BaseTestMixin(QueueTestMixin):
|
class BaseTestMixin(QueueTestMixin):
|
||||||
'''
|
'''
|
||||||
Mixin with shared code for use by all test cases.
|
Mixin with shared code for use by all test cases.
|
||||||
@@ -96,6 +96,7 @@ class BaseTestMixin(QueueTestMixin):
|
|||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BaseTestMixin, self).setUp()
|
super(BaseTestMixin, self).setUp()
|
||||||
|
global ansible_version
|
||||||
|
|
||||||
self.object_ctr = 0
|
self.object_ctr = 0
|
||||||
# Save sys.path before tests.
|
# Save sys.path before tests.
|
||||||
@@ -108,7 +109,7 @@ class BaseTestMixin(QueueTestMixin):
|
|||||||
self._temp_paths = []
|
self._temp_paths = []
|
||||||
self._current_auth = None
|
self._current_auth = None
|
||||||
self._user_passwords = {}
|
self._user_passwords = {}
|
||||||
self.ansible_version = get_ansible_version()
|
self.ansible_version = ansible_version
|
||||||
self.assertNotEqual(self.ansible_version, 'unknown')
|
self.assertNotEqual(self.ansible_version, 'unknown')
|
||||||
# Wrap settings so we can redefine them within each test.
|
# Wrap settings so we can redefine them within each test.
|
||||||
self._wrapped = settings._wrapped
|
self._wrapped = settings._wrapped
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ if 'django_jenkins' in INSTALLED_APPS:
|
|||||||
JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'),
|
JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'),
|
||||||
os.path.join(BASE_DIR, 'ui/static/lib/ansible'),]
|
os.path.join(BASE_DIR, 'ui/static/lib/ansible'),]
|
||||||
|
|
||||||
|
# Much faster than the default
|
||||||
|
# https://docs.djangoproject.com/en/1.6/topics/auth/passwords/#how-django-stores-passwords
|
||||||
|
PASSWORD_HASHERS = (
|
||||||
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
||||||
|
)
|
||||||
|
|
||||||
# Configure a default UUID for development only.
|
# Configure a default UUID for development only.
|
||||||
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user