Projet

Général

Profil

0001-tests-run-tests-using-postgres-45105.patch

Nicolas Roche, 14 juillet 2020 13:42

Télécharger (1,86 ko)

Voir les différences:

Subject: [PATCH 1/2] tests: run tests using postgres (#45105)

 tests/settings.py | 9 +++++++++
 tox.ini           | 2 ++
 2 files changed, 11 insertions(+)
tests/settings.py
1
import os
2

  
1 3
# Add corbo hobo agent
2 4
INSTALLED_APPS = ('corbo.hobo_agent', 'hobo.agent.common') + INSTALLED_APPS
3 5

  
4 6
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.BasicAuthentication']
7

  
8
DATABASES = {
9
    'default': {
10
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
11
        'TEST': {'NAME': 'chrono-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],},
12
    }
13
}
tox.ini
1 1
[tox]
2 2
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/corbo/{env:BRANCH_NAME:}
3 3
envlist = py2-coverage-django111,py3-django111,py3-django22
4 4

  
5 5
[testenv]
6 6
usedevelop =
7 7
  coverage: True
8 8
setenv =
9
  DB_ENGINE=django.db.backends.postgresql_psycopg2
9 10
  DJANGO_SETTINGS_MODULE=corbo.settings
10 11
  CORBO_SETTINGS_FILE=tests/settings.py
11 12
  coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=corbo/ --cov-config .coveragerc
12 13
deps =
13 14
  django111: django>=1.11,<1.12
14 15
  django22: django>=2.2,<2.3
15 16
  http://git.entrouvert.org/hobo.git/snapshot/hobo-master.tar.gz
16 17
  pytest-cov
......
18 19
  pytest
19 20
  django-webtest
20 21
  premailer<3.7
21 22
  git+http://git.entrouvert.org/debian/django-ckeditor.git
22 23
  djangorestframework>=3.3,<3.8
23 24
  pylint
24 25
  astroid
25 26
  mock
27
  psycopg2-binary
26 28
commands =
27 29
  py.test {env:COVERAGE:} {posargs:tests/}
28
-