Skip to content

Commit

Permalink
Fix tests for Django 1.4/Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
acatton committed Jul 29, 2014
1 parent c9d6d5b commit 8ddbb3a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion betterforms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
except ImportError:
# Support for Python < 2.6
from django.utils.datastructures import SortedDict as OrderedDict
from django.utils import six
import six # Django six is buggy with Django < 1.5
from django.utils.encoding import python_2_unicode_compatible


Expand Down
8 changes: 7 additions & 1 deletion betterforms/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import unittest # NOQA
import sys
if sys.version_info < (2, 7):
# In python < 2.7 unittest doesn't have expectedFailure
from django.utils import unittest
else:
# django.utils.unittest became deprecated in Django 1.7
import unittest # NOQA

import mock

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def get_version():
packages=[package for package in find_packages() if package.startswith('betterforms')],
install_requires=[
'Django>=1.4',
'six',
],
tests_require=[
'mock>=1.0.1',
Expand Down
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,60 @@ deps =
https://github.com/django/django/archive/stable/1.4.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py27-dj15]
basepython=python2.7
deps =
https://github.com/django/django/archive/stable/1.5.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py27-dj16]
basepython=python2.7
deps =
https://github.com/django/django/archive/stable/1.6.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py27-dj17]
basepython=python2.7
deps =
https://github.com/django/django/archive/stable/1.7.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py33-dj15]
basepython=python3.3
deps =
https://github.com/django/django/archive/stable/1.5.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py33-dj16]
basepython=python3.3
deps =
https://github.com/django/django/archive/stable/1.6.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py33-dj17]
basepython=python3.3
deps =
https://github.com/django/django/archive/stable/1.7.x.zip#egg=Django
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

[testenv:py26-dj14]
basepython=python2.6
deps =
Django==1.4.8
# https://bitbucket.org/hpk42/tox/issue/13/tox-should-reuse-tests_require
mock
six

0 comments on commit 8ddbb3a

Please sign in to comment.