Projet

Général

Profil

0001-tests-use-postgres-instead-of-sqlite-42500.patch

Nicolas Roche, 05 mai 2020 15:42

Télécharger (2,14 ko)

Voir les différences:

Subject: [PATCH] tests: use postgres instead of sqlite (#42500)

 config_example.py      | 2 +-
 passerelle/settings.py | 2 +-
 tests/settings.py      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
config_example.py
3 3
SECRET_KEY = 'changeme'
4 4

  
5 5
MEDIA_ROOT = 'media'
6 6

  
7 7
STATIC_ROOT = 'collected-static'
8 8

  
9 9
DATABASES = {
10 10
    'default': {
11
        'ENGINE': 'django.db.backends.sqlite3',
11
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
12 12
        'NAME':  'passerelle.sqlite3',
13 13
    }
14 14
}
passerelle/settings.py
26 26
# SECURITY WARNING: don't run with debug turned on in production!
27 27
DEBUG = True
28 28

  
29 29
# See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
30 30
ALLOWED_HOSTS = []
31 31

  
32 32
DATABASES = {
33 33
    'default': {
34
        'ENGINE': 'django.db.backends.sqlite3',
34
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
35 35
        'NAME': 'passerelle.sqlite3',
36 36
    }
37 37
}
38 38

  
39 39
### End of "Quick-start development settings"
40 40

  
41 41

  
42 42
# If you set this to False, Django will not format dates, numbers and
tests/settings.py
55 55
    },
56 56
    'dummy': {
57 57
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache'
58 58
    }
59 59
}
60 60

  
61 61
DATABASES = {
62 62
    'default': {
63
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
63
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.postgresql_psycopg2'),
64 64
        'TEST': {
65 65
            'NAME': 'passerelle-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],
66 66
        },
67 67
    }
68 68
}
69 69

  
70 70
LOGGED_REQUESTS_MAX_SIZE = 4999
71
-