tests: set db backend from environment, then force postgresql

This commit is contained in:
Frédéric Péters 2020-05-20 19:35:44 +02:00
parent 1ecb13df6b
commit 7867a21702
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import os
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
@ -5,4 +7,11 @@ INSTALLED_APPS += (
'passerelle_montpellier_encombrants',
)
DATABASES = {
'default': {
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
'TEST': {
'NAME': 'passerelle-montpellier-encombrants-test-%s' % os.environ.get('BRANCH_NAME', '').replace('/', '-')[:63],
},
}
}

View File

@ -9,10 +9,12 @@ usedevelop =
setenv =
DJANGO_SETTINGS_MODULE=passerelle.settings
PASSERELLE_SETTINGS_FILE=tests/settings.py
DB_ENGINE=django.db.backends.postgresql_psycopg2
coverage: COVERAGE=--cov-report xml --cov-report html --cov=passerelle_montpellier_encombrants/
junit: JUNIT=--junitxml=junit-{envname}.xml
deps =
http://git.entrouvert.org/passerelle.git/snapshot/passerelle-master.tar.gz
psycopg2-binary
xmlschema<1.1
psycopg2
pytest