diff --git a/awx/main/tests/unit/settings/test_development.py b/awx/main/tests/unit/settings/test_development.py deleted file mode 100644 index a6012f8d26..0000000000 --- a/awx/main/tests/unit/settings/test_development.py +++ /dev/null @@ -1,5 +0,0 @@ - -def test_ANSIBLE_VERSION(mocker): - from django.conf import settings - assert hasattr(settings, 'ANSIBLE_VERSION') - diff --git a/awx/main/tests/unit/test_utils.py b/awx/main/tests/unit/test_utils.py deleted file mode 100644 index f16f107c16..0000000000 --- a/awx/main/tests/unit/test_utils.py +++ /dev/null @@ -1,19 +0,0 @@ -import subprocess - -from awx.main.utils import get_ansible_version - -def test_dev(mocker, settings): - settings.ANSIBLE_VERSION = mocker.Mock() - - res = get_ansible_version() - - assert res == settings.ANSIBLE_VERSION - -def test_production(mocker, settings): - mock_Popen = mocker.MagicMock() - mocker.patch.object(subprocess, 'Popen', mock_Popen) - del settings.ANSIBLE_VERSION - - get_ansible_version() - - mock_Popen.assert_called_with(['ansible', '--version'], stdout=subprocess.PIPE) diff --git a/awx/main/utils.py b/awx/main/utils.py index 4a7ce90f54..f1d85f72b2 100644 --- a/awx/main/utils.py +++ b/awx/main/utils.py @@ -97,9 +97,6 @@ def get_ansible_version(): ''' Return Ansible version installed. ''' - from django.conf import settings - if hasattr(settings, 'ANSIBLE_VERSION'): - return settings.ANSIBLE_VERSION try: proc = subprocess.Popen(['ansible', '--version'], stdout=subprocess.PIPE) diff --git a/awx/settings/development.py b/awx/settings/development.py index a9ae83b242..cc4febdbae 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -10,8 +10,6 @@ import traceback # Django Split Settings from split_settings.tools import optional, include -from awx.main.utils import get_ansible_version - # Load default settings. from defaults import * # NOQA @@ -35,8 +33,6 @@ AWX_PROOT_ENABLED = True PENDO_TRACKING_STATE = "off" -ANSIBLE_VERSION = get_ansible_version() - # Use Django-Jenkins if installed. Only run tests for awx.main app. try: import django_jenkins