Skip to content

Commit 5e77b08

Browse files
committed
Test that migrations work on mysql in travis
1 parent 38f1791 commit 5e77b08

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ install:
99
- pip install https://github.com/dcramer/pyflakes/tarball/master
1010
- pip install -q -e . --use-mirrors
1111
- pip install south
12+
services:
13+
- mysql
1214
before_script:
1315
- "pep8 --ignore=E124,E128 --exclude=tests,migrations cities_light"
16+
- mysql -e 'create database cities_light_test;'
1417
script:
1518
- python setup.py test
1619
- rm -rf test_project/db.sqlite
1720
- python test_project/manage.py syncdb --noinput
1821
- python test_project/manage.py migrate
22+
- python test_project/manage.py syncdb --noinput --settings test_project.settings_mysql
23+
- python test_project/manage.py migrate --settings test_project.settings_mysql
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.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
6+
'NAME': 'cities_light_test', # Or path to database file if using sqlite3.
7+
'USER': 'root', # 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)