From 3ae1e8aae3423341a0f6dcf046f6fc68df490f37 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 15 May 2018 03:41:17 +0900 Subject: [PATCH] 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 Add py35dj20 job to test Django 2.0 integration. Change-Id: I6d2e38201387012ba9a02c4b0bd8377895a5919a --- mistraldashboard/action_executions/tables.py | 2 +- mistraldashboard/action_executions/tests.py | 2 +- mistraldashboard/action_executions/views.py | 4 ++-- mistraldashboard/actions/forms.py | 2 +- mistraldashboard/actions/tables.py | 2 +- mistraldashboard/actions/tests.py | 2 +- mistraldashboard/actions/views.py | 4 ++-- mistraldashboard/cron_triggers/tables.py | 2 +- mistraldashboard/cron_triggers/tests.py | 2 +- mistraldashboard/cron_triggers/views.py | 4 ++-- mistraldashboard/executions/forms.py | 2 +- mistraldashboard/executions/tests.py | 2 +- mistraldashboard/executions/views.py | 4 ++-- mistraldashboard/tasks/tables.py | 2 +- mistraldashboard/tasks/tests.py | 2 +- mistraldashboard/tasks/views.py | 4 ++-- mistraldashboard/workbooks/forms.py | 2 +- mistraldashboard/workbooks/tests.py | 2 +- mistraldashboard/workbooks/views.py | 4 ++-- mistraldashboard/workflows/forms.py | 2 +- mistraldashboard/workflows/tests.py | 2 +- mistraldashboard/workflows/views.py | 4 ++-- tox.ini | 6 ++++++ 23 files changed, 35 insertions(+), 29 deletions(-) diff --git a/mistraldashboard/action_executions/tables.py b/mistraldashboard/action_executions/tables.py index d618735..52f391e 100644 --- a/mistraldashboard/action_executions/tables.py +++ b/mistraldashboard/action_executions/tables.py @@ -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 diff --git a/mistraldashboard/action_executions/tests.py b/mistraldashboard/action_executions/tests.py index 20dd2aa..8eb7aaa 100644 --- a/mistraldashboard/action_executions/tests.py +++ b/mistraldashboard/action_executions/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/action_executions/views.py b/mistraldashboard/action_executions/views.py index 9e91f0e..45986e1 100644 --- a/mistraldashboard/action_executions/views.py +++ b/mistraldashboard/action_executions/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/mistraldashboard/actions/forms.py b/mistraldashboard/actions/forms.py index 05f72a9..9665b1f 100644 --- a/mistraldashboard/actions/forms.py +++ b/mistraldashboard/actions/forms.py @@ -14,7 +14,7 @@ import json -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/mistraldashboard/actions/tables.py b/mistraldashboard/actions/tables.py index 44562d0..bde3cd9 100644 --- a/mistraldashboard/actions/tables.py +++ b/mistraldashboard/actions/tables.py @@ -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 diff --git a/mistraldashboard/actions/tests.py b/mistraldashboard/actions/tests.py index cf11a38..decdda5 100644 --- a/mistraldashboard/actions/tests.py +++ b/mistraldashboard/actions/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/actions/views.py b/mistraldashboard/actions/views.py index 1e01561..92b97fd 100644 --- a/mistraldashboard/actions/views.py +++ b/mistraldashboard/actions/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/mistraldashboard/cron_triggers/tables.py b/mistraldashboard/cron_triggers/tables.py index b538e02..6869fb6 100644 --- a/mistraldashboard/cron_triggers/tables.py +++ b/mistraldashboard/cron_triggers/tables.py @@ -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 diff --git a/mistraldashboard/cron_triggers/tests.py b/mistraldashboard/cron_triggers/tests.py index c44fc4f..64e9658 100644 --- a/mistraldashboard/cron_triggers/tests.py +++ b/mistraldashboard/cron_triggers/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/cron_triggers/views.py b/mistraldashboard/cron_triggers/views.py index 2ca2ffc..6e4dfb3 100644 --- a/mistraldashboard/cron_triggers/views.py +++ b/mistraldashboard/cron_triggers/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/mistraldashboard/executions/forms.py b/mistraldashboard/executions/forms.py index 34d06da..93fd851 100644 --- a/mistraldashboard/executions/forms.py +++ b/mistraldashboard/executions/forms.py @@ -10,7 +10,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 diff --git a/mistraldashboard/executions/tests.py b/mistraldashboard/executions/tests.py index 542320b..3cbea17 100644 --- a/mistraldashboard/executions/tests.py +++ b/mistraldashboard/executions/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/executions/views.py b/mistraldashboard/executions/views.py index 1dcc300..b905cac 100644 --- a/mistraldashboard/executions/views.py +++ b/mistraldashboard/executions/views.py @@ -14,8 +14,8 @@ from django.views import generic -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 diff --git a/mistraldashboard/tasks/tables.py b/mistraldashboard/tasks/tables.py index dda2a60..3fe3df4 100644 --- a/mistraldashboard/tasks/tables.py +++ b/mistraldashboard/tasks/tables.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.core.urlresolvers import reverse from django.template.defaultfilters import title +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/mistraldashboard/tasks/tests.py b/mistraldashboard/tasks/tests.py index 7d63f19..452c453 100644 --- a/mistraldashboard/tasks/tests.py +++ b/mistraldashboard/tasks/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/tasks/views.py b/mistraldashboard/tasks/views.py index 7c03ce8..5c862fe 100644 --- a/mistraldashboard/tasks/views.py +++ b/mistraldashboard/tasks/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/mistraldashboard/workbooks/forms.py b/mistraldashboard/workbooks/forms.py index d98a1e2..4207b8f 100644 --- a/mistraldashboard/workbooks/forms.py +++ b/mistraldashboard/workbooks/forms.py @@ -14,7 +14,7 @@ import six -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/mistraldashboard/workbooks/tests.py b/mistraldashboard/workbooks/tests.py index 7f6680f..8e6adb7 100644 --- a/mistraldashboard/workbooks/tests.py +++ b/mistraldashboard/workbooks/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/workbooks/views.py b/mistraldashboard/workbooks/views.py index 137cbb4..9bb1d59 100644 --- a/mistraldashboard/workbooks/views.py +++ b/mistraldashboard/workbooks/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/mistraldashboard/workflows/forms.py b/mistraldashboard/workflows/forms.py index f05a3f2..dd11357 100644 --- a/mistraldashboard/workflows/forms.py +++ b/mistraldashboard/workflows/forms.py @@ -14,7 +14,7 @@ import six -from django.core.urlresolvers import reverse +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/mistraldashboard/workflows/tests.py b/mistraldashboard/workflows/tests.py index d4616c3..97c476a 100644 --- a/mistraldashboard/workflows/tests.py +++ b/mistraldashboard/workflows/tests.py @@ -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 mistraldashboard.test import helpers as test diff --git a/mistraldashboard/workflows/views.py b/mistraldashboard/workflows/views.py index 7ce8eb4..39b770c 100644 --- a/mistraldashboard/workflows/views.py +++ b/mistraldashboard/workflows/views.py @@ -12,8 +12,8 @@ # See the 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 django.views import generic diff --git a/tox.ini b/tox.ini index 1d853fd..03c778d 100644 --- a/tox.ini +++ b/tox.ini @@ -41,3 +41,9 @@ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools,hori [testenv:releasenotes] commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html + +[testenv:py35dj20] +basepython = python3.5 +commands = + pip install django>=2.0,<2.1 + {[testenv]commands}