From b5ef1cd72d8712d3b067f102266b0f6d89311f01 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Fri, 8 May 2015 21:17:38 -0400 Subject: [PATCH 1/2] speedup each test case by .03 seconds --- awx/main/tests/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/main/tests/base.py b/awx/main/tests/base.py index c33c6fa8e8..354158eff5 100644 --- a/awx/main/tests/base.py +++ b/awx/main/tests/base.py @@ -88,7 +88,7 @@ class QueueStartStopTestMixin(QueueTestMixin): super(QueueStartStopTestMixin, self).tearDown() self.terminate_queue() - +ansible_version = get_ansible_version() class BaseTestMixin(QueueTestMixin): ''' Mixin with shared code for use by all test cases. @@ -96,6 +96,7 @@ class BaseTestMixin(QueueTestMixin): def setUp(self): super(BaseTestMixin, self).setUp() + global ansible_version self.object_ctr = 0 # Save sys.path before tests. @@ -108,7 +109,7 @@ class BaseTestMixin(QueueTestMixin): self._temp_paths = [] self._current_auth = None self._user_passwords = {} - self.ansible_version = get_ansible_version() + self.ansible_version = ansible_version self.assertNotEqual(self.ansible_version, 'unknown') # Wrap settings so we can redefine them within each test. self._wrapped = settings._wrapped From 7d7206c7b05601d7862e1fe6acaad3460732f7f7 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Sat, 9 May 2015 08:13:14 -0400 Subject: [PATCH 2/2] use md5 pass hasher when dev or testing --- awx/settings/development.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/settings/development.py b/awx/settings/development.py index 77e5156c4c..f0c66ffaed 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -53,6 +53,12 @@ if 'django_jenkins' in INSTALLED_APPS: JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'), 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. SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'