Skip to content

Commit 832436b

Browse files
committed
Use tox to verify Django version compatibility
1 parent 587f35e commit 832436b

File tree

5 files changed

+37
-10
lines changed

5 files changed

+37
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
.coverage
77
/htmlcov/*
88
*.swp
9+
.tox

multigtfs/tests/frequency.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515

1616
from datetime import date
17+
from json import loads
1718
import StringIO
1819

1920
from django.core.serializers import serialize
@@ -107,9 +108,14 @@ def test_serialize(self):
107108
Frequency.objects.create(
108109
trip=self.trip, start_time='05:00', end_time='25:00',
109110
headway_secs=1800)
110-
json = serialize('json', Frequency.objects.all())
111-
self.assertEqual(
112-
json,
113-
'[{"pk": 1, "model": "multigtfs.frequency",'
114-
' "fields": {"exact_times": "", "start_time": "05:00:00",'
115-
' "headway_secs": 1800, "trip": 1, "end_time": "25:00:00"}}]')
111+
actual = loads(serialize('json', Frequency.objects.all()))
112+
expected = [{
113+
"pk": 1,
114+
"model": "multigtfs.frequency",
115+
"fields": {
116+
"exact_times": "",
117+
"start_time": "05:00:00",
118+
"headway_secs": 1800,
119+
"trip": 1,
120+
"end_time": "25:00:00"}}]
121+
self.assertEqual(expected, actual)

requirements.txt

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
Django>=1.3.2,<1.7
22
South==0.7.6
3-
pytz==2011n
4-
transitfeed==1.2.12
5-
wsgiref==0.1.2

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ def read(*paths):
3333
license='Apache License 2.0',
3434
url='https://github.com/tulsawebdevs/django-multi-gtfs',
3535
packages=find_packages(),
36-
install_requires=['Django>=1.3'],
36+
install_requires=['Django>=1.5'],
3737
keywords='django gtfs',
38+
test_suite = "run_tests",
3839
classifiers=[
3940
"Development Status :: 4 - Beta",
4041
"Environment :: Web Environment",

tox.ini

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tox]
2+
envlist =
3+
py27-django15,
4+
py27-django16
5+
6+
[testenv]
7+
deps=
8+
nose
9+
django-nose
10+
commands=./run_tests.py
11+
12+
[testenv:py27-django15]
13+
basepython = python2.7
14+
deps =
15+
Django>=1.5,<1.6
16+
{[testenv]deps}
17+
18+
[testenv:py27-django16]
19+
basepython = python2.7
20+
deps =
21+
Django>=1.6,<1.7
22+
{[testenv]deps}

0 commit comments

Comments
 (0)