mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-17 04:10:24 +00:00
Allow running tests using sqlite
This commit is contained in:
parent
208e226c72
commit
e6833a2d52
1 changed files with 19 additions and 10 deletions
|
|
@ -4,16 +4,25 @@ INSTALLED_APPS = (
|
|||
'model_utils',
|
||||
'tests',
|
||||
)
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": os.environ.get("DB_NAME", "modelutils"),
|
||||
"USER": os.environ.get("DB_USER", 'postgres'),
|
||||
"PASSWORD": os.environ.get("DB_PASSWORD", ""),
|
||||
"HOST": os.environ.get("DB_HOST", "localhost"),
|
||||
"PORT": os.environ.get("DB_PORT", 5432)
|
||||
},
|
||||
}
|
||||
|
||||
if os.environ.get('SQLITE'):
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
},
|
||||
}
|
||||
else:
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": os.environ.get("DB_NAME", "modelutils"),
|
||||
"USER": os.environ.get("DB_USER", 'postgres'),
|
||||
"PASSWORD": os.environ.get("DB_PASSWORD", ""),
|
||||
"HOST": os.environ.get("DB_HOST", "localhost"),
|
||||
"PORT": os.environ.get("DB_PORT", 5432)
|
||||
},
|
||||
}
|
||||
|
||||
SECRET_KEY = 'dummy'
|
||||
|
||||
CACHES = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue