diff --git a/.gitignore b/.gitignore index 75a0e78..39d1fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.egg-info *.pyc .coverage +.tox dist/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f8bbef3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: python + +python: + - 2.6 + - 2.7 + +env: + - DJANGO=Django==1.4.10 + - DJANGO=Django==1.5.5 + - DJANGO=Django==1.6.2 + +install: + - pip install $DJANGO + - pip install nose + +script: + - nosetests tests.py diff --git a/djpjax.py b/djpjax.py index 6cc559c..5be3e5d 100644 --- a/djpjax.py +++ b/djpjax.py @@ -1,6 +1,10 @@ import functools from django.views.generic.base import TemplateResponseMixin +try: + from django.utils.six import string_types +except ImportError: + string_types = basestring def pjax(pjax_template=None): def pjax_decorator(view): @@ -54,7 +58,7 @@ def get_template_names(self): def _pjaxify_template_var(template_var): if isinstance(template_var, (list, tuple)): template_var = type(template_var)(_pjaxify_template_name(name) for name in template_var) - elif isinstance(template_var, basestring): + elif isinstance(template_var, string_types): template_var = _pjaxify_template_name(template_var) return template_var diff --git a/setup.py b/setup.py index b7ee328..6d398bc 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,9 @@ def read(fname): 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', 'Programming Language :: Python', ), ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..c87348f --- /dev/null +++ b/tox.ini @@ -0,0 +1,89 @@ +[tox] +envlist = + py26-1.3, py26-1.4, py26-1.5, py26-1.6, + py27-1.3, py27-1.4, py27-1.5, py27-1.6, + py32-1.5, py32-1.6, + py33-1.5, py33-1.6, + + +[testenv] +commands = nosetests tests.py + + +[testenv:py26-1.3] +basepython = python2.6 +deps = + django == 1.3.7 + nose + + +[testenv:py26-1.4] +basepython = python2.6 +deps = + django == 1.4.10 + nose + +[testenv:py26-1.5] +basepython = python2.6 +deps = + django == 1.5.5 + nose + +[testenv:py26-1.6] +basepython = python2.6 +deps = + django == 1.6.2 + nose + + +[testenv:py27-1.3] +basepython = python2.7 +deps = + django == 1.3.7 + nose + + +[testenv:py27-1.4] +basepython = python2.7 +deps = + django == 1.4.10 + nose + +[testenv:py27-1.5] +basepython = python2.7 +deps = + django == 1.5.5 + nose + +[testenv:py27-1.6] +basepython = python2.7 +deps = + django == 1.6.2 + nose + + +[testenv:py32-1.5] +basepython = python3.2 +deps = + django == 1.5 + nose + +[testenv:py32-1.6] +basepython = python3.2 +deps = + django == 1.6.2 + nose + + + +[testenv:py33-1.5] +basepython = python3.3 +deps = + django == 1.5 + nose + +[testenv:py33-1.6] +basepython = python3.3 +deps = + django == 1.6.2 + nose