forked from yourlabs/django-cities-light
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
32 lines (26 loc) · 812 Bytes
/
test.sh
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
30
31
32
#!/usr/bin/env bash
set -x
set -e
function do_db() {
python test_project/manage.py syncdb --traceback --noinput --settings=test_project.$1
python test_project/manage.py migrate --noinput --traceback --settings=test_project.$1
python test_project/manage.py cities_light --force-import-all --traceback --settings=test_project.$1
}
pip install south
if [[ $DB = 'mysql' ]]; then
if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then
pip install mysql-python
else
pip install -e git+https://github.com/clelland/MySQL-for-Python-3.git#egg=mysql-python
fi
# test on mysql
do_db settings_mysql
fi
if [[ $DB = 'postgresql' ]]; then
pip install psycopg2
do_db settings_postgres
fi
if [[ $DB = 'sqlite' ]]; then
rm -rf test_project/db.sqlite
do_db settings
fi