tests: run tests using postgres (#45105)

This commit is contained in:
Nicolas Roche 2020-07-14 13:39:01 +02:00
parent fbc224a625
commit e365818a35
2 changed files with 11 additions and 0 deletions

View File

@ -1,4 +1,13 @@
import os
# Add corbo hobo agent
INSTALLED_APPS = ('corbo.hobo_agent', 'hobo.agent.common') + INSTALLED_APPS
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.BasicAuthentication']
DATABASES = {
'default': {
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
'TEST': {'NAME': 'chrono-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],},
}
}

View File

@ -6,6 +6,7 @@ envlist = py2-coverage-django111,py3-django111,py3-django22
usedevelop =
coverage: True
setenv =
DB_ENGINE=django.db.backends.postgresql_psycopg2
DJANGO_SETTINGS_MODULE=corbo.settings
CORBO_SETTINGS_FILE=tests/settings.py
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=corbo/ --cov-config .coveragerc
@ -23,5 +24,6 @@ deps =
pylint
astroid
mock
psycopg2-binary
commands =
py.test {env:COVERAGE:} {posargs:tests/}