Skip to content

Commit

Permalink
Fix tests with Django master (2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham authored Feb 3, 2017
1 parent b8d73b1 commit 164f0f4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ env:
- TOXENV=py27-django-18
- TOXENV=py27-django-19
- TOXENV=py27-django-110
- TOXENV=py27-django-master
- TOXENV=py33-django-18
- TOXENV=py34-django-18
- TOXENV=py34-django-19
- TOXENV=py34-django-110
- TOXENV=py34-django-master
global:
- PIP_WHEEL_DIR=$HOME/.wheels
- PIP_FIND_LINKS=file:https://$HOME/.wheels
Expand Down
6 changes: 5 additions & 1 deletion formtools/wizard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from collections import OrderedDict

from django import forms
from django.core.urlresolvers import reverse
from django.forms import ValidationError, formsets
from django.shortcuts import redirect
from django.utils import six
Expand All @@ -14,6 +13,11 @@
from .storage import get_storage
from .storage.exceptions import NoFileStorageConfigured

try:
from django.urls import reverse
except ImportError: # Django 1.9 and earlier
from django.core.urlresolvers import reverse


def normalize_name(name):
"""
Expand Down
7 changes: 7 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
}
}

MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
]

# Django 1.9 and earlier
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
Expand Down
6 changes: 5 additions & 1 deletion tests/wizard/namedwizardtests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import copy

from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test import TestCase, override_settings
from django.utils._os import upath
Expand All @@ -15,6 +14,11 @@
from ..test_forms import Step1, Step2, get_request
from .forms import temp_storage

try:
from django.urls import reverse
except ImportError: # Django 1.9 and earlier
from django.core.urlresolvers import reverse

# On Python 2, __file__ may end with .pyc
THIS_FILE = upath(__file__).rstrip("c")
UPLOADED_FILE_NAME = 'tests.py'
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
args_are_paths = false
envlist =
{py27,py34}-django-{18,19,110,master}
{py27,py34}-django-{18,19,110}
py33-django-{18}
py35-django-{18,19,110,master}

Expand Down

0 comments on commit 164f0f4

Please sign in to comment.