introduce test_settings

This commit is contained in:
Gael Pasgrimaud
2016-03-10 12:46:44 +01:00
parent be06f5d8b8
commit 101a773bfd
2 changed files with 39 additions and 35 deletions
+38
View File
@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
import os
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DB = os.environ.get('DB', 'POSTGRES')
if DB == 'MYSQL':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'modoboa_test',
'USER': 'modoboa',
'PASSWORD': 'modoboa',
'HOST': 'localhost',
'PORT': '',
'ATOMIC_REQUESTS': True,
},
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'modoboa_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
'ATOMIC_REQUESTS': True,
},
}
+1 -35
View File
@@ -14,6 +14,7 @@ from logging.handlers import SysLogHandler
from django.conf import global_settings
from modoboa.test_settings import *
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
@@ -91,40 +92,6 @@ ROOT_URLCONF = 'test_project.urls'
WSGI_APPLICATION = 'test_project.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
if os.environ.get('DB') == 'MYSQL':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'modoboa_test',
'USER': 'modoboa',
'PASSWORD': 'modoboa',
'HOST': 'localhost',
'PORT': '',
'ATOMIC_REQUESTS': True,
},
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'modoboa_test',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
'ATOMIC_REQUESTS': True,
},
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
@@ -201,4 +168,3 @@ LOGGING = {
}
}
}