aboutsummaryrefslogtreecommitdiff
path: root/tagging/tests/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'tagging/tests/settings.py')
-rw-r--r--tagging/tests/settings.py50
1 files changed, 31 insertions, 19 deletions
diff --git a/tagging/tests/settings.py b/tagging/tests/settings.py
index 74eb909..3648f2e 100644
--- a/tagging/tests/settings.py
+++ b/tagging/tests/settings.py
@@ -1,27 +1,39 @@
+"""Tests settings"""
import os
-DIRNAME = os.path.dirname(__file__)
-DEFAULT_CHARSET = 'utf-8'
+SECRET_KEY = 'secret-key'
-test_engine = os.environ.get("TAGGING_TEST_ENGINE", "sqlite3")
+DATABASES = {
+ 'default': {
+ 'NAME': 'tagging.db',
+ 'ENGINE': 'django.db.backends.sqlite3'
+ }
+}
-DATABASE_ENGINE = test_engine
-DATABASE_NAME = os.environ.get("TAGGING_DATABASE_NAME", "tagging_test")
-DATABASE_USER = os.environ.get("TAGGING_DATABASE_USER", "")
-DATABASE_PASSWORD = os.environ.get("TAGGING_DATABASE_PASSWORD", "")
-DATABASE_HOST = os.environ.get("TAGGING_DATABASE_HOST", "localhost")
+DATABASE_ENGINE = os.environ.get('DATABASE_ENGINE')
+if DATABASE_ENGINE == 'postgres':
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': 'tagging',
+ 'USER': 'postgres',
+ 'HOST': 'localhost'
+ }
+ }
+elif DATABASE_ENGINE == 'mysql':
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': 'zinnia',
+ 'USER': 'root',
+ 'HOST': 'localhost'
+ }
+ }
-if test_engine == "sqlite":
- DATABASE_NAME = os.path.join(DIRNAME, 'tagging_test.db')
- DATABASE_HOST = ""
-elif test_engine == "mysql":
- DATABASE_PORT = os.environ.get("TAGGING_DATABASE_PORT", 3306)
-elif test_engine == "postgresql_psycopg2":
- DATABASE_PORT = os.environ.get("TAGGING_DATABASE_PORT", 5432)
-
-
-INSTALLED_APPS = (
+INSTALLED_APPS = [
+ 'django.contrib.auth',
+ 'django.contrib.sessions',
'django.contrib.contenttypes',
'tagging',
'tagging.tests',
-)
+]