-
Notifications
You must be signed in to change notification settings - Fork 33
/
t_overrides.travis.py
29 lines (25 loc) · 1.18 KB
/
t_overrides.travis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copy to test_overrides.py, make changes
import os
def update(old_config):
config = old_config.copy()
if os.environ.get('MULTIGTFS_TEST_POSTGIS', False):
# Run tests under PostgreSQL / PostGIS
# Requires psycopg2:
# pip install psycopg2
# Requires the PostgreSQL role with SUPERUSER and CREATEDB permission
# createuser multigtfs --superuser --createdb --pwprompt
# Requires the PostgreSQL database w/ PostGIS extensions:
# createdb multigtfs --owner=multigtfs
# psql -d multigtfs -c "CREATE EXTENSION postgis"
# psql -d multigtfs -c "CREATE EXTENSION postgis_topology"
# Running the test creates a new database 'test_multigtfs'
# Because superuser permissions are needed, it is recommended that you
# only install on a local database, and change configuration items
# below.
config['DATABASE_ENGINE'] = 'django.contrib.gis.db.backends.postgis'
config['DATABASES'] = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'multigtfs',
'USER': 'postgres'}}
return config