File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,33 @@ 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 :
14
+ exclude :
15
+ - python : 3.2
16
+ env : DATABASE_ENGINE=mysql
17
+ - python : 3.3
18
+ env : DATABASE_ENGINE=mysql
19
+ - python : 3.4
20
+ env : DATABASE_ENGINE=mysql
11
21
fast_finish : true
12
22
install :
13
23
- pip install -U setuptools
14
24
- python bootstrap.py
15
25
- ./bin/buildout versions:django=$DJANGO
26
+ - sh -c "if [ '$DATABASE_ENGINE' = 'postgres' ];
27
+ then
28
+ pip install psycopg2;
29
+ psql -c 'create database tagging;' -U postgres;
30
+ fi"
31
+ - sh -c "if [ '$DATABASE_ENGINE' = 'mysql' ];
32
+ then
33
+ pip install mysql-python;
34
+ mysql -e 'create database tagging CHARACTER SET utf8 COLLATE utf8_general_ci;';
35
+ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql;
36
+ fi"
16
37
before_script :
17
38
- ./bin/flake8 tagging
18
39
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' ,
Original file line number Diff line number Diff line change 1
1
"""
2
2
Tests utils for tagging.
3
3
"""
4
-
5
4
from django .template .loader import BaseLoader
6
5
6
+
7
7
class VoidLoader (BaseLoader ):
8
8
"""
9
9
Template loader which is always returning
You can’t perform that action at this time.
0 commit comments