forked from gmcquillan/django-brake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_settings.py
37 lines (29 loc) · 902 Bytes
/
test_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
DATABASES = {'default':{
'NAME':':memory:',
'ENGINE':'django.db.backends.sqlite3'
}}
# install the bare minimum for
# testing django-brake
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'brake',
)
# This is where our ratelimiting information is stored.
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
}
}
RATELIMIT_CACHE_BACKEND = 'brake.tests.custom_backend.MyBrake'
RATELIMIT_STATUS_CODE = 429 # The HTTP Response code to return.
# point to ourselves as the root urlconf, define no patterns (see below)
ROOT_URLCONF = 'test_settings'
# set this to turn off an annoying "you're doing it wrong" message
SECRET_KEY = 'HAHAHA ratelimits!'
# turn this file into a pseudo-urls.py.
try:
from django.conf.urls import patterns
urlpatterns = patterns('',)
except ImportError:
urlpatterns = []