Skip to content

Commit caf527b

Browse files
committed
Add Mysql tests
1 parent 02c919e commit caf527b

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ install:
66

77
before_script:
88
- psql -c 'create database django_like_example;' -U postgres
9+
- mysql -e 'create database django_like_example;'
910
script:
1011
- coverage erase
1112
- tox

example/example/settings/mysql.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from example.settings.base import *
2+
3+
DATABASES['default']['NAME'] = 'django_like_example'
4+
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
5+
6+
import django
7+
8+
if django.VERSION[0] == 1 and django.VERSION[1] <= 1:
9+
DATABASE_ENGINE = DATABASES['default']['ENGINE'] # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
10+
DATABASE_NAME = DATABASES['default']['NAME']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from example.settings.mysql import *
2+
3+
DEBUG = False
4+
TEMPLATE_DEBUG = DEBUG
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from example.settings.mysql import *
2+
3+
django_like_index = INSTALLED_APPS.index('django_like')
4+
5+
INSTALLED_APPS = INSTALLED_APPS[:django_like_index] + INSTALLED_APPS[django_like_index + 1:]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from example.settings.mysql_patche import *
2+
3+
DEBUG = False
4+
TEMPLATE_DEBUG = DEBUG

tox.ini

+48
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ commands =
99
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
1010
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
1111
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
12+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
13+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
1214
install_command =
1315
pip install {opts} {packages}
1416

@@ -19,18 +21,23 @@ commands =
1921
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
2022
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
2123
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
24+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
25+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
2226
patch -p2 -N -d {toxinidir}/.tox/py26-dj16/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
2327
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
2428
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
2529
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
2630
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
31+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
32+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
2733
patch -p2 -R -N -d {toxinidir}/.tox/py26-dj16/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
2834
deps =
2935
django==1.6
3036
pillow==1.7.8
3137
PyYAML==3.10
3238
coveralls==0.3
3339
psycopg2==2.5.1
40+
MySQL-python==1.2.4
3441

3542
[testenv:py26-dj15]
3643
basepython = python2.6
@@ -39,18 +46,23 @@ commands =
3946
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
4047
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
4148
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
49+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
50+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
4251
patch -p2 -N -d {toxinidir}/.tox/py26-dj15/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
4352
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
4453
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
4554
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
4655
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
56+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
57+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
4758
patch -p2 -R -N -d {toxinidir}/.tox/py26-dj15/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
4859
deps =
4960
django==1.5.5
5061
pillow==1.7.8
5162
PyYAML==3.10
5263
coveralls==0.3
5364
psycopg2==2.5.1
65+
MySQL-python==1.2.4
5466

5567
[testenv:py26-dj14]
5668
basepython = python2.6
@@ -59,18 +71,23 @@ commands =
5971
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
6072
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
6173
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
74+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
75+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
6276
patch -p1 -N -d {toxinidir}/.tox/py26-dj14/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.r17282
6377
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
6478
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
6579
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
6680
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
81+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
82+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
6783
patch -p1 -R -N -d {toxinidir}/.tox/py26-dj14/lib/python2.6/site-packages/django/ -i {toxinidir}/patches/patch.r17282
6884
deps =
6985
django==1.4.10
7086
pillow==1.7.8
7187
PyYAML==3.10
7288
coveralls==0.3
7389
psycopg2==2.5.1
90+
MySQL-python==1.2.4
7491

7592
[testenv:py26-dj13]
7693
basepython = python2.6
@@ -80,6 +97,7 @@ deps =
8097
PyYAML==3.10
8198
coveralls==0.3
8299
psycopg2==2.4.1
100+
MySQL-python==1.2.4
83101

84102
[testenv:py26-dj12]
85103
basepython = python2.6
@@ -89,6 +107,7 @@ deps =
89107
PyYAML==3.10
90108
coveralls==0.3
91109
psycopg2==2.4.1
110+
MySQL-python==1.2.4
92111

93112
[testenv:py26-dj11]
94113
basepython = python2.6
@@ -98,6 +117,7 @@ deps =
98117
PyYAML==3.10
99118
coveralls==0.3
100119
psycopg2==2.4.1
120+
MySQL-python==1.2.4
101121

102122
[testenv:py27-dj16]
103123
basepython = python2.7
@@ -106,18 +126,23 @@ commands =
106126
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
107127
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
108128
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
129+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
130+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
109131
patch -p2 -N -d {toxinidir}/.tox/py27-dj16/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
110132
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
111133
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
112134
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
113135
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
136+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
137+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
114138
patch -p2 -R -N -d {toxinidir}/.tox/py27-dj16/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
115139
deps =
116140
django==1.6
117141
pillow==1.7.8
118142
PyYAML==3.10
119143
coveralls==0.3
120144
psycopg2==2.5.1
145+
MySQL-python==1.2.4
121146

122147
[testenv:py27-dj15]
123148
basepython = python2.7
@@ -126,18 +151,23 @@ commands =
126151
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
127152
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
128153
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
154+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
155+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
129156
patch -p2 -N -d {toxinidir}/.tox/py27-dj15/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
130157
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
131158
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
132159
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
133160
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
161+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
162+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
134163
patch -p2 -R -N -d {toxinidir}/.tox/py27-dj15/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
135164
deps =
136165
django==1.5.5
137166
pillow==1.7.8
138167
PyYAML==3.10
139168
coveralls==0.3
140169
psycopg2==2.5.1
170+
MySQL-python==1.2.4
141171

142172
[testenv:py27-dj14]
143173
basepython = python2.7
@@ -146,18 +176,23 @@ commands =
146176
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
147177
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
148178
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
179+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
180+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
149181
patch -p1 -N -d {toxinidir}/.tox/py27-dj14/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.r17282
150182
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
151183
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
152184
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
153185
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
186+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
187+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
154188
patch -p1 -R -N -d {toxinidir}/.tox/py27-dj14/lib/python2.7/site-packages/django/ -i {toxinidir}/patches/patch.r17282
155189
deps =
156190
django==1.4.10
157191
pillow==1.7.8
158192
PyYAML==3.10
159193
coveralls==0.3
160194
psycopg2==2.5.1
195+
MySQL-python==1.2.4
161196

162197
[testenv:py27-dj13]
163198
basepython = python2.7
@@ -167,6 +202,7 @@ deps =
167202
PyYAML==3.10
168203
coveralls==0.3
169204
psycopg2==2.4.1
205+
MySQL-python==1.2.4
170206

171207
[testenv:py27-dj12]
172208
basepython = python2.7
@@ -176,6 +212,7 @@ deps =
176212
PyYAML==3.10
177213
coveralls==0.3
178214
psycopg2==2.4.1
215+
MySQL-python==1.2.4
179216

180217
[testenv:py27-dj11]
181218
basepython = python2.7
@@ -185,6 +222,7 @@ deps =
185222
PyYAML==3.10
186223
coveralls==0.3
187224
psycopg2==2.4.1
225+
MySQL-python==1.2.4
188226

189227
[testenv:py33-dj16]
190228
basepython = python3.3
@@ -193,18 +231,23 @@ commands =
193231
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
194232
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
195233
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
234+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
235+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
196236
patch -p2 -N -d {toxinidir}/.tox/py33-dj16/lib/python3.3/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
197237
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
198238
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
199239
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
200240
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
241+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
242+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
201243
patch -p2 -R -N -d {toxinidir}/.tox/py33-dj16/lib/python3.3/site-packages/django/ -i {toxinidir}/patches/patch.6691ab
202244
deps =
203245
django==1.6
204246
pillow==2.1.0
205247
PyYAML==3.10
206248
coveralls==0.3
207249
psycopg2==2.5.1
250+
MySQL-python==1.2.4
208251

209252

210253
[testenv:py33-dj15]
@@ -214,15 +257,20 @@ commands =
214257
python {envbindir}/coverage run -p example/run_tests.py example.settings.no_debug
215258
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres
216259
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_no_debug
260+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql
261+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_no_debug
217262
patch -p2 -N -d {toxinidir}/.tox/py33-dj15/lib/python3.3/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
218263
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche
219264
python {envbindir}/coverage run -p example/run_tests.py example.settings.patche_no_debug
220265
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche
221266
python {envbindir}/coverage run -p example/run_tests.py example.settings.postgres_patche_no_debug
267+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche
268+
python {envbindir}/coverage run -p example/run_tests.py example.settings.mysql_patche_no_debug
222269
patch -p2 -R -N -d {toxinidir}/.tox/py33-dj15/lib/python3.3/site-packages/django/ -i {toxinidir}/patches/patch.2847ae
223270
deps =
224271
django==1.5.5
225272
pillow==2.1.0
226273
PyYAML==3.10
227274
coveralls==0.3
228275
psycopg2==2.5.1
276+
MySQL-python==1.2.4

0 commit comments

Comments
 (0)