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 depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

Add py35dj20 job to test Django 2.0 integration.
Also drops py27dj110 from tox.ini as horizon droped
Django 1.10 support in Rocky.

blueprint django2-support

Change-Id: I8e0dcb64e1c82580767db482631450ba38654fc3
This commit is contained in:
Akihiro Motoki 2018-03-11 10:01:16 +09:00
parent c709d55379
commit 36e8f3999e
10 changed files with 20 additions and 14 deletions

View File

@ -4,8 +4,14 @@
- openstack-tox-lower-constraints:
required-projects:
- openstack/horizon
- horizon-openstack-tox-py35dj20:
required-projects:
- openstack/horizon
gate:
jobs:
- openstack-tox-lower-constraints:
required-projects:
- openstack/horizon
- horizon-openstack-tox-py35dj20:
required-projects:
- openstack/horizon

View File

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

View File

@ -14,8 +14,8 @@
import logging
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.urls import reverse
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy

View File

@ -14,7 +14,7 @@
import mock
from django.core.urlresolvers import reverse
from django.urls import reverse
from openstack_dashboard import api
from openstack_dashboard.test import helpers

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions

View File

@ -15,7 +15,7 @@
import logging
from operator import attrgetter
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms

View File

@ -14,8 +14,8 @@
import logging
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.urls import reverse
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.core.urlresolvers import reverse
from django.urls import reverse
import mock
from openstack_dashboard.test import helpers

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions

View File

@ -1,5 +1,5 @@
[tox]
envlist = py35,py27,pep8
envlist = py35,py27,pep8,py35dj20
minversion = 2.3.2
skipsdist = True
@ -35,10 +35,10 @@ commands =
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
[testenv:py27dj110]
basepython = python2.7
[testenv:py35dj20]
basepython = python3.5
commands =
pip install django>=1.10,<1.11
pip install django>=2.0,<2.1
{[unit_tests]commands}
[testenv:docs]