mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
introduce test_settings
This commit is contained in:
@@ -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,
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
@@ -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 = {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user