From fc17c80b70f270d775ef284212c8bec86213767a Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 21 Mar 2018 11:39:46 +0300 Subject: [PATCH] Django 2.0 support. --- .travis.yml | 5 +++++ runtests.py | 10 ++++++++++ webshell/__init__.py | 3 ++- webshell/tests.py | 5 ++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36a031e..826b1be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,11 @@ env: - DJANGO=1.11 - DJANGO=2.0 +matrix: + exclude: + - python: "2.7" + env: DJANGO=2.0 + install: - pip install Django==$DJANGO - pip install coveralls diff --git a/runtests.py b/runtests.py index 292032c..a620220 100644 --- a/runtests.py +++ b/runtests.py @@ -55,6 +55,16 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ], + MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + ], + ROOT_URLCONF='testurls', DEBUG=False, ) diff --git a/webshell/__init__.py b/webshell/__init__.py index 971332d..997542d 100644 --- a/webshell/__init__.py +++ b/webshell/__init__.py @@ -1,7 +1,8 @@ -VERSION = (0, 2, 4) +VERSION = (0, 2, 5) def get_version(): return '.'.join(map(str, VERSION)) + __version__ = get_version() diff --git a/webshell/tests.py b/webshell/tests.py index 16d730d..024d578 100644 --- a/webshell/tests.py +++ b/webshell/tests.py @@ -1,8 +1,11 @@ # coding: utf-8 from django.test import TestCase from django.conf import settings -from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model +try: + from django.core.urlresolvers import reverse +except ImportError: + from django.urls import reverse from webshell.models import Script