File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,26 @@ python:
7
7
env :
8
8
- DJANGO=1.7
9
9
- DJANGO=1.8
10
+ - DATABASE_ENGINE=sqlite
11
+ - DATABASE_ENGINE=postgres
12
+ - DATABASE_ENGINE=mysql
10
13
matrix :
11
14
fast_finish : true
12
15
install :
13
16
- pip install -U setuptools
14
17
- python bootstrap.py
15
18
- ./bin/buildout versions:django=$DJANGO
19
+ - sh -c "if [ '$DATABASE_ENGINE' = 'postgres' ];
20
+ then
21
+ pip install psycopg2;
22
+ psql -c 'create database tagging;' -U postgres;
23
+ fi"
24
+ - sh -c "if [ '$DATABASE_ENGINE' = 'mysql' ];
25
+ then
26
+ pip install mysql-python;
27
+ mysql -e 'create database tagging CHARACTER SET utf8 COLLATE utf8_general_ci;';
28
+ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql;
29
+ fi"
16
30
before_script :
17
31
- ./bin/flake8 tagging
18
32
script :
Original file line number Diff line number Diff line change 1
1
"""Tests settings"""
2
+ import os
2
3
3
4
SECRET_KEY = 'secret-key'
4
5
9
10
}
10
11
}
11
12
13
+ DATABASE_ENGINE = os .environ .get ('DATABASE_ENGINE' )
14
+ if DATABASE_ENGINE == 'postgres' :
15
+ DATABASES = {
16
+ 'default' : {
17
+ 'ENGINE' : 'django.db.backends.postgresql_psycopg2' ,
18
+ 'NAME' : 'tagging' ,
19
+ 'USER' : 'postgres' ,
20
+ 'HOST' : 'localhost'
21
+ }
22
+ }
23
+ elif DATABASE_ENGINE == 'mysql' :
24
+ DATABASES = {
25
+ 'default' : {
26
+ 'ENGINE' : 'django.db.backends.mysql' ,
27
+ 'NAME' : 'zinnia' ,
28
+ 'USER' : 'root' ,
29
+ 'HOST' : 'localhost'
30
+ }
31
+ }
32
+
12
33
INSTALLED_APPS = [
13
34
'django.contrib.auth' ,
14
35
'django.contrib.sessions' ,
You can’t perform that action at this time.
0 commit comments