Django 2.0 support

Horizon and most horizon plugins support Django 2.0 in Rocky.
This commit focuses on passing the unit tests with Django 2.0.
It would be nice if masakari-dashboard team tests it in
real environments.

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

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

Change-Id: I67907a2460f8472e5a6222210d74b3eed71be064
This commit is contained in:
Akihiro Motoki 2018-08-27 02:36:16 +09:00
parent 253294f0b5
commit 4052bde700
11 changed files with 13 additions and 19 deletions

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.translation import ugettext_lazy as _
from horizon import exceptions

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.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy

View File

@ -13,7 +13,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 masakaridashboard.test import helpers as test

View File

@ -13,8 +13,8 @@
# limitations under the License.
from django.conf import settings
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

@ -13,8 +13,8 @@
# limitations under the License.
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.urls import reverse
from django.utils.http import urlunquote
import mock

View File

@ -13,7 +13,7 @@
# limitations under the License.
from django.conf import settings
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

@ -13,7 +13,7 @@
# 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.translation import ugettext_lazy as _
from horizon import exceptions

View File

@ -13,7 +13,7 @@
# 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.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy

View File

@ -16,8 +16,8 @@
import mock
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.urls import reverse
from django.utils.http import urlunquote
from openstack_dashboard.test import helpers

View File

@ -14,8 +14,8 @@
# under the License.
from django.conf import settings
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 tables

View File

@ -1,5 +1,5 @@
[tox]
envlist = py35,py27,py27dj18,pep8
envlist = py35,py27,pep8
minversion = 2.0
skipsdist = True
@ -32,12 +32,6 @@ commands =
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
[testenv:py27dj18]
basepython = python2.7
commands =
pip install django>=1.8,<1.9
{[testenv]commands}
[testenv:eslint]
whitelist_externals = npm
commands =