Skip to content

Commit a13ad79

Browse files
committed
Added tests for postgres
1 parent 626ceed commit a13ad79

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ install:
88
- pip install pep8 --use-mirrors
99
- pip install https://github.com/dcramer/pyflakes/tarball/master
1010
- pip install -q -e . --use-mirrors
11-
- pip install south mysql-python
12-
services:
13-
- mysql
11+
- pip install south mysql-python psycopg2
1412
before_script:
1513
- "pep8 --ignore=E124,E128 --exclude=tests,migrations cities_light"
1614
- mysql -e 'create database cities_light_test;'
15+
- psql -c 'create database cities_light_test;' -U postgres
1716
script:
1817
- python setup.py test
1918
- rm -rf test_project/db.sqlite
2019
- python test_project/manage.py syncdb --noinput
2120
- python test_project/manage.py migrate
2221
- python test_project/manage.py syncdb --noinput --settings test_project.settings_mysql
2322
- python test_project/manage.py migrate --settings test_project.settings_mysql
23+
- python test_project/manage.py syncdb --noinput --settings test_project.settings_postgres
24+
- python test_project/manage.py migrate --settings test_project.settings_postgres
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from settings import *
2+
3+
DATABASES = {
4+
'default': {
5+
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
6+
'NAME': 'cities_light_test', # Or path to database file if using sqlite3.
7+
'USER': 'postgres', # Not used with sqlite3.
8+
'PASSWORD': '', # Not used with sqlite3.
9+
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
10+
'PORT': '', # Set to empty string for default. Not used with sqlite3.
11+
}
12+
}
13+
14+

0 commit comments

Comments
 (0)