django-axes/axes/test_settings.py
Jack Sullivan 95917a951e In tests, only set cooldown if testing it
The results for the cache unit tests were inconsistent, sometimes
blocking and other time allowing. The source of the non-determinism
was the COOLDOWN_TIME set to 2 seconds in the test. If a test took
slightly longer than the cooldown time, it would fail. Testing times
on Travis CI vary with each build, and would produce unreliable
results.

Now all tests have no cooldown period, except when the cooldown
itself is being tested. This ensures accurate and predicable test
results.
2017-04-26 12:49:44 -07:00

55 lines
1.2 KiB
Python

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
SITE_ID = 1
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'axes.test_urls'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'axes.apps.AppConfig',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
SECRET_KEY = 'too-secret-for-test'
USE_I18N = False
USE_L10N = False
USE_TZ = False
LOGIN_REDIRECT_URL = '/admin/'
AXES_LOGIN_FAILURE_LIMIT = 10