Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test multiple Django and Python versions on Travis ci; also added tox support #157

Merged
merged 6 commits into from
Feb 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
language: python
python:
- 2.6
- 2.7
env:
- DJANGO_VERSION=1.3.5
- DJANGO_VERSION=1.4.3
- DJANGO_VERSION=1.5c1
install:
- "if [[ $DJANGO_VERSION == '1.5c1' ]]; then pip install https://www.djangoproject.com/download/1.5c1/tarball/; else pip install Django==$DJANGO_VERSION; fi"
- "pip install . --use-mirrors"
- "pip install -r testproject/requirements.txt --use-mirrors"
script:
Expand All @@ -12,3 +18,4 @@ branches:
only:
- master
- dev
- tox
8 changes: 7 additions & 1 deletion fiber/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import re

from django.conf.urls import patterns, url
try:
# Django >= 1.4
from django.conf.urls import patterns, url
except ImportError:
# Django 1.3
from django.conf.urls.defaults import patterns, url

from django.views.generic import View
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
Expand Down
2 changes: 1 addition & 1 deletion fiber/utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __call__(self, value):
# check if it starts with http(s):// | ftp(s)://
# Django's validator only works with full urls that include a protocol.
if self.protocol_regex.search(url):
django_url_validator = URLValidator(verify_exists=False)
django_url_validator = URLValidator()
django_url_validator(url)
else:
# check if it's a named url, and if so, if it's reversible
Expand Down
5 changes: 2 additions & 3 deletions testproject/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
coverage==3.5.3
django-jenkins==0.13.0
Django==1.4.2
coverage==3.6
django-jenkins==0.14.0
29 changes: 0 additions & 29 deletions testproject/testproject/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,35 +125,6 @@
'django.contrib.admin',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}

try:
import django_jenkins
installed_apps = list(INSTALLED_APPS)
Expand Down
8 changes: 7 additions & 1 deletion testproject/testproject/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
try:
# Django >= 1.4
from django.conf.urls import patterns, include
except ImportError:
# Django 1.3
from django.conf.urls.defaults import patterns, include

from django.conf import settings
from django.conf.urls import patterns, include
from django.conf.urls.static import static
from django.contrib import admin

Expand Down
45 changes: 45 additions & 0 deletions testproject/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[tox]
envlist = django1.3-py26,django1.3-py27,django1.4-py26,django1.4-py27,django1.5-py26,django1.5-py27
setupdir = ..

[testenv]
deps =
django-jenkins==0.14.0
commands =
python manage.py jenkins

[testenv:django1.3-py26]
basepython = python2.6
deps =
Django==1.3.5
{[testenv]deps}

[testenv:django1.3-py27]
basepython = python2.7
deps =
Django==1.3.5
{[testenv]deps}

[testenv:django1.4-py26]
basepython = python2.6
deps =
Django==1.4.3
{[testenv]deps}

[testenv:django1.4-py27]
basepython = python2.7
deps =
Django==1.4.3
{[testenv]deps}

[testenv:django1.5-py26]
basepython = python2.6
deps =
https://www.djangoproject.com/download/1.5c1/tarball/
{[testenv]deps}

[testenv:django1.5-py27]
basepython = python2.7
deps =
https://www.djangoproject.com/download/1.5c1/tarball/
{[testenv]deps}