Skip to content

Commit

Permalink
feat: test with both Python 3.5 and Django 1.10
Browse files Browse the repository at this point in the history
Update matrix to support all django versions for Python 3.5 and
all python versions for Django 1.10
  • Loading branch information
asfaltboy committed Jan 3, 2017
1 parent 6541b53 commit 200f314
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,37 @@ python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
matrix:
include:
- python: "2.6"
env: DJANGO="Django>=1.5,<1.6"
- python: "2.6"
env: DJANGO="Django>=1.6,<1.7"
- python: "3.4"
env: DJANGO="Django>=1.9,<1.10"
- python: "3.4"
env: DJANGO="Django>=1.10,<1.11"
- python: "3.5"
env: DJANGO="Django>=1.9,<1.10"
- python: "3.5"
env: DJANGO="Django>=1.10,<1.11"
exclude:
- python: "2.6"
- python: "3.3"
env: DJANGO="Django>=1.9,<1.10"
- python: "3.3"
env: DJANGO="Django>=1.10,<1.11"
- python: "3.4"
- python: "3.5"
env:
- DJANGO="Django>=1.5,<1.6"
- DJANGO="Django>=1.6,<1.7"
- DJANGO="Django>=1.7,<1.8"
- DJANGO="Django>=1.8,<1.9"
- DJANGO="Django>=1.9,<1.10"
- DJANGO="Django>=1.10,<1.11"
install:
- pip install $DJANGO
- pip install -e .[test]
Expand Down
4 changes: 4 additions & 0 deletions advanced_filters/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def test_invalid_args(self):
self.assert_view_error(
'expected length 2, got 1',
model='a', field_name='b', exception=ValueError)
elif sys.version_info >= (3, 5):
self.assert_view_error(
'not enough values to unpack (expected 2, got 1)', model='a',
field_name='b', exception=ValueError)
else:
self.assert_view_error(
'need more than 1 value to unpack', model='a',
Expand Down
6 changes: 6 additions & 0 deletions tests/test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
WSGI_APPLICATION = 'tests.test_project.wsgi.application'

AUTH_USER_MODEL = 'reps.SalesRep'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
},
]

# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
Expand Down
7 changes: 3 additions & 4 deletions tests/test_project/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.contrib import admin

admin.autodiscover() # django < 1.7 support

urlpatterns = patterns(
'',
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^advanced_filters/', include('advanced_filters.urls'))
)
]
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[tox]
envlist =
py26-{d15,d16}
py27-{d15,d16,d17,d18,d19}
{py33,py34}-{d15,d16,d17,d18}
{py34}-{d18,d19}
pypy-{d15,d16,d17,d18,d19}
py26-d{15,16}
py27-d{15,16,17,18,19,110}
py{33,34}-d{15,16,17,18}
py34-d{19,110}
py35-d{18,19,110}
pypy-d{15,16,17,18,19,110}

[pep8]
max-line-length = 120
Expand All @@ -16,6 +17,7 @@ deps =
d17: Django>=1.7,<1.8
d18: Django>=1.8,<1.9
d19: Django>=1.9,<1.10
d110: Django>=1.10,<1.11
py26: unittest2
-rtest-reqs.txt

Expand Down

0 comments on commit 200f314

Please sign in to comment.