Django 2.0 support

Replace django.core.urlresolves with django.urls

(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was deprecated in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

Note that this commit does not add py35dj20 like other horizon plugins
because there is no actual python unit tests in freezer-web-ui.

Older Django unit tests were dropped from tox.ini
as horizon dropped Django <=1.10 support in Rocky.

Change-Id: I38f3f05655324f2a5f38c6e8c6ab53ebaa42d4c8
This commit is contained in:
Akihiro Motoki 2018-05-14 02:18:54 +09:00
parent f2feb0f056
commit 6bf20357fe
10 changed files with 10 additions and 21 deletions

View File

@ -15,7 +15,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables
from django.core.urlresolvers import reverse
from django.urls import reverse
import disaster_recovery.api.api as freezer_api

View File

@ -12,7 +12,7 @@
import pprint
from django.core.urlresolvers import reverse_lazy
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views import generic

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.utils import safestring
from django.utils.translation import ungettext_lazy
from django.utils.translation import ugettext_lazy as _

View File

@ -14,7 +14,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables
from django.core.urlresolvers import reverse
from django.urls import reverse
import disaster_recovery.api.api as freezer_api
from disaster_recovery.utils import shield

View File

@ -18,7 +18,7 @@ from django.utils.translation import ungettext_lazy
from horizon import tables
from horizon import messages
from django.core.urlresolvers import reverse
from django.urls import reverse
import disaster_recovery.api.api as freezer_api
from disaster_recovery.utils import shield

View File

@ -14,7 +14,7 @@
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.core.urlresolvers import reverse
from django.urls import reverse
from horizon import tables

View File

@ -13,7 +13,7 @@
# limitations under the License.
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.urls import reverse
from horizon import exceptions
from horizon import forms

View File

@ -14,7 +14,7 @@
import datetime
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _

View File

@ -17,7 +17,7 @@ import re
from functools import wraps
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.template.defaultfilters import date as django_date
from django.utils.translation import ugettext_lazy as _

13
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py27dj18,pep8,py35,py35dj18,pylint
envlist = py27,pep8,py35,pylint
minversion = 1.6
skipsdist = True
@ -25,17 +25,6 @@ commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:py27dj18]
basepython = python2.7
commands =
python manage.py test {posargs}
[testenv:py35dj18]
basepython = python3.5
commands =
python manage.py test {posargs}
[testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=disaster_recovery.test.settings
commands = python setup.py build_sphinx