mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
Don't use Redis as cache when running tests.
This commit is contained in:
@@ -351,13 +351,20 @@ CELERYBEAT_SCHEDULE = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use Redis as cache backend.
|
# Use Redis as cache backend (except when testing).
|
||||||
CACHES = {
|
if is_testing():
|
||||||
'default': {
|
CACHES = {
|
||||||
'BACKEND': 'redis_cache.RedisCache',
|
'default': {
|
||||||
'LOCATION': BROKER_URL,
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
else:
|
||||||
|
CACHES = {
|
||||||
|
'default': {
|
||||||
|
'BACKEND': 'redis_cache.RedisCache',
|
||||||
|
'LOCATION': BROKER_URL,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
# Social Auth configuration.
|
# Social Auth configuration.
|
||||||
SOCIAL_AUTH_STRATEGY = 'social.strategies.django_strategy.DjangoStrategy'
|
SOCIAL_AUTH_STRATEGY = 'social.strategies.django_strategy.DjangoStrategy'
|
||||||
|
|||||||
@@ -34,4 +34,5 @@ if not AUTH_BASIC_ENABLED:
|
|||||||
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = [x for x in REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] if x != 'rest_framework.authentication.BasicAuthentication']
|
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = [x for x in REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] if x != 'rest_framework.authentication.BasicAuthentication']
|
||||||
|
|
||||||
# Update cache to use celery broker URL defined in configuration files.
|
# Update cache to use celery broker URL defined in configuration files.
|
||||||
CACHES['default']['LOCATION'] = BROKER_URL
|
if CACHES['default']['BACKEND'] == 'redis_cache.RedisCache':
|
||||||
|
CACHES['default']['LOCATION'] = BROKER_URL
|
||||||
|
|||||||
Reference in New Issue
Block a user