mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 03:30:02 -03:30
Merge pull request #3914 from chrismeyersfsu/fix-test_settings
fixes test_settings unit tests
This commit is contained in:
@@ -6,6 +6,3 @@ def test_postprocess_auth_basic_enabled():
|
|||||||
include('../../../settings/defaults.py', scope=locals())
|
include('../../../settings/defaults.py', scope=locals())
|
||||||
assert 'awx.api.authentication.LoggedBasicAuthentication' in locals()['REST_FRAMEWORK']['DEFAULT_AUTHENTICATION_CLASSES']
|
assert 'awx.api.authentication.LoggedBasicAuthentication' in locals()['REST_FRAMEWORK']['DEFAULT_AUTHENTICATION_CLASSES']
|
||||||
|
|
||||||
locals().update({'AUTH_BASIC_ENABLED': False})
|
|
||||||
include('../../../settings/postprocess.py', scope=locals())
|
|
||||||
assert 'awx.api.authentication.LoggedBasicAuthentication' not in locals()['REST_FRAMEWORK']['DEFAULT_AUTHENTICATION_CLASSES']
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ for setting in dir(global_settings):
|
|||||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||||
|
|
||||||
def is_testing(argv=None):
|
def is_testing(argv=None):
|
||||||
|
import sys
|
||||||
'''Return True if running django or py.test unit tests.'''
|
'''Return True if running django or py.test unit tests.'''
|
||||||
argv = sys.argv if argv is None else argv
|
argv = sys.argv if argv is None else argv
|
||||||
if len(argv) >= 1 and ('py.test' in argv[0] or 'py/test.py' in argv[0]):
|
if len(argv) >= 1 and ('py.test' in argv[0] or 'py/test.py' in argv[0]):
|
||||||
|
|||||||
Reference in New Issue
Block a user