Project

General

Profile

0013-tests-run-tests-with-postgres-fixes-30458.patch

Benjamin Dauvergne, 08 Feb 2019 08:43 AM

Download (3.49 KB)

View differences:

Subject: [PATCH 13/13] tests: run tests with postgres (fixes #30458)

 tests/settings.py | 57 ++++++++++++++++++++++++++++-------------------
 tox.ini           |  5 ++++-
 2 files changed, 38 insertions(+), 24 deletions(-)
tests/settings.py
1
import os
2

  
1 3
LANGUAGE_CODE = 'en-us'
2 4
TIME_ZONE = 'UTC'
3 5

  
......
13 15

  
14 16
# include all contrib apps
15 17
INSTALLED_APPS += (
16
        'passerelle.contrib.adict',
17
        'passerelle.contrib.agoraplus',
18
        'passerelle.contrib.dpark',
19
        'passerelle.contrib.fake_family',
20
        'passerelle.contrib.gdema',
21
        'passerelle.contrib.grandlyon_streetsections',
22
        'passerelle.contrib.greco',
23
        'passerelle.contrib.grenoble_gru',
24
        'passerelle.contrib.iparapheur',
25
        'passerelle.contrib.iws',
26
        'passerelle.contrib.maarch',
27
        'passerelle.contrib.mdel',
28
        'passerelle.contrib.meyzieu_newsletters',
29
        'passerelle.contrib.nancypoll',
30
        'passerelle.contrib.planitech',
31
        'passerelle.contrib.seisin_by_email',
32
        'passerelle.contrib.solis_apa',
33
        'passerelle.contrib.strasbourg_eu',
34
        'passerelle.contrib.stub_invoices',
35
        'passerelle.contrib.teamnet_axel',
36
        'passerelle.contrib.tlmcom',
37
        'passerelle.contrib.tcl',
38
        )
18
    'passerelle.contrib.adict',
19
    'passerelle.contrib.agoraplus',
20
    'passerelle.contrib.dpark',
21
    'passerelle.contrib.fake_family',
22
    'passerelle.contrib.gdema',
23
    'passerelle.contrib.grandlyon_streetsections',
24
    'passerelle.contrib.greco',
25
    'passerelle.contrib.grenoble_gru',
26
    'passerelle.contrib.iparapheur',
27
    'passerelle.contrib.iws',
28
    'passerelle.contrib.maarch',
29
    'passerelle.contrib.mdel',
30
    'passerelle.contrib.meyzieu_newsletters',
31
    'passerelle.contrib.nancypoll',
32
    'passerelle.contrib.planitech',
33
    'passerelle.contrib.seisin_by_email',
34
    'passerelle.contrib.solis_apa',
35
    'passerelle.contrib.strasbourg_eu',
36
    'passerelle.contrib.stub_invoices',
37
    'passerelle.contrib.teamnet_axel',
38
    'passerelle.contrib.tlmcom',
39
    'passerelle.contrib.tcl',
40
)
39 41

  
40 42
# enable applications that are otherwise disabled
41 43
PASSERELLE_APP_BDP_ENABLED = True
......
54 56
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache'
55 57
    }
56 58
}
59

  
60
DATABASES = {
61
    'default': {
62
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
63
        'TEST': {
64
            'NAME': 'passerelle-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
65
        },
66
    }
67
}
tox.ini
1 1
[tox]
2 2
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:BRANCH_NAME:}
3
envlist = django{18,111}
3
envlist = django{18,111}-{sqlite,pg}
4 4

  
5 5
[testenv]
6 6
usedevelop = True
......
9 9
  DJANGO_SETTINGS_MODULE=passerelle.settings
10 10
  PASSERELLE_SETTINGS_FILE=tests/settings.py
11 11
  fast: FAST=--nomigrations
12
  sqlite: DB_ENGINE=django.db.backends.sqlite3
13
  pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
12 14
deps =
13 15
  django18: django>=1.8,<1.9
14 16
  django111: django>=1.11,<1.12
17
  pg: psycopg2-binary
15 18
  pytest-cov
16 19
  pytest-django<3.4.6
17 20
  pytest
18
-