aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-01 18:24:54 +0100
committerAymeric Augustin2013-11-01 18:24:54 +0100
commit50b13fb575dc79d849d1d79cb5619cce52b42f9d (patch)
treef0bdd6f251131822c9db815b0ef12b9edb31cd84 /tests
parent3003c95626617c5c5331ddf10373e867b6610a63 (diff)
downloaddjango-debug-toolbar-50b13fb575dc79d849d1d79cb5619cce52b42f9d.tar.bz2
Get rid of custom test runner.
Refs #426.
Diffstat (limited to 'tests')
-rw-r--r--tests/__init__.py12
-rw-r--r--tests/settings.py58
2 files changed, 70 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index e69de29..3b83e4c 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -0,0 +1,12 @@
+# Refresh the debug toolbar's configuration when overriding settings.
+
+from debug_toolbar.utils.settings import CONFIG, CONFIG_DEFAULTS
+from django.dispatch import receiver
+from django.test.signals import setting_changed
+
+
+@receiver(setting_changed)
+def update_toolbar_config(**kwargs):
+ if kwargs['setting'] == 'DEBUG_TOOLBAR_CONFIG':
+ CONFIG.update(CONFIG_DEFAULTS)
+ CONFIG.update(kwargs['value'] or {})
diff --git a/tests/settings.py b/tests/settings.py
new file mode 100644
index 0000000..2d993f5
--- /dev/null
+++ b/tests/settings.py
@@ -0,0 +1,58 @@
+"""Django settings for tests."""
+
+import os
+BASE_DIR = os.path.dirname(os.path.dirname(__file__))
+
+
+# Quick-start development settings - unsuitable for production
+
+SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
+
+DEBUG = True
+
+INTERNAL_IPS = ['127.0.0.1', '::1']
+
+TEMPLATE_DEBUG = True
+
+
+# Application definition
+
+INSTALLED_APPS = (
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'debug_toolbar',
+ 'tests',
+)
+
+MIDDLEWARE_CLASSES = (
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+)
+
+ROOT_URLCONF = 'tests.urls'
+
+STATIC_URL = '/static/'
+
+
+# Cache and database
+
+CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+ }
+}
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ }
+}