diff options
author | Zuul <zuul@review.opendev.org> | 2022-03-10 12:24:44 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-03-10 12:24:44 +0000 |
commit | 52a1025047b2d8f82a88369da243fa72b1bd9b20 (patch) | |
tree | 33c68be534ec887b64c147c00e0bffab67cee581 /openstack_dashboard/dashboards | |
parent | cf9a30d39ee7759c15340eb90ed2d13f326ebf32 (diff) | |
parent | e4444e69790a117ef821e0a9af3dcff4e16095eb (diff) | |
download | horizon-52a1025047b2d8f82a88369da243fa72b1bd9b20.tar.gz |
Merge "Address RemovedInDjango40Warning (4)"
Diffstat (limited to 'openstack_dashboard/dashboards')
10 files changed, 47 insertions, 45 deletions
diff --git a/openstack_dashboard/dashboards/admin/backups/tests.py b/openstack_dashboard/dashboards/admin/backups/tests.py index 060614636..c247ab460 100644 --- a/openstack_dashboard/dashboards/admin/backups/tests.py +++ b/openstack_dashboard/dashboards/admin/backups/tests.py @@ -10,11 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. +from urllib import parse + from django.conf import settings from django.test.utils import override_settings from django.urls import reverse from django.utils.http import urlencode -from django.utils.http import urlunquote from openstack_dashboard import api from openstack_dashboard.dashboards.admin.backups \ @@ -40,7 +41,7 @@ class AdminVolumeBackupsViewTests(test.BaseAdminViewTests): = self.cinder_volume_snapshots.list() self.mock_tenant_list.return_value = [self.tenants.list(), False] - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertEqual(res.status_code, 200) self.assertTemplateUsed(res, 'horizon/common/_data_table_view.html') diff --git a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py index 155054356..4f9478d53 100644 --- a/openstack_dashboard/dashboards/admin/networks/subnets/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/subnets/tests.py @@ -15,6 +15,7 @@ import collections from unittest import mock +from urllib import parse from django.urls import reverse @@ -410,9 +411,8 @@ class NetworkSubnetTests(test.BaseAdminViewTests): self.mock_subnet_list.return_value = [self.subnets.first()] self.mock_tenant_quota_usages.return_value = quota_data - from django.utils.http import urlunquote - url = urlunquote(reverse('horizon:admin:networks:subnets_tab', - args=[network.id])) + url = parse.unquote(reverse('horizon:admin:networks:subnets_tab', + args=[network.id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') subnets = res.context['subnets_table'].data diff --git a/openstack_dashboard/dashboards/admin/networks/tests.py b/openstack_dashboard/dashboards/admin/networks/tests.py index f2ac0b2ce..7f7973c9e 100644 --- a/openstack_dashboard/dashboards/admin/networks/tests.py +++ b/openstack_dashboard/dashboards/admin/networks/tests.py @@ -14,9 +14,9 @@ import collections from unittest import mock +from urllib import parse from django.urls import reverse -from django.utils.http import urlunquote from horizon import forms @@ -123,8 +123,8 @@ class NetworkTests(test.BaseAdminViewTests): 'mac-learning': mac_learning, 'dhcp_agent_scheduler': True}) - url = urlunquote(reverse('horizon:admin:networks:detail', - args=[network.id])) + url = parse.unquote(reverse('horizon:admin:networks:detail', + args=[network.id])) res = self.client.get(url) network = res.context['network'] @@ -171,8 +171,8 @@ class NetworkTests(test.BaseAdminViewTests): 'dhcp_agent_scheduler': True}) self.mock_tenant_quota_usages.return_value = quota_data - url = urlunquote(reverse('horizon:admin:networks:subnets_tab', - args=[network.id])) + url = parse.unquote(reverse('horizon:admin:networks:subnets_tab', + args=[network.id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') @@ -215,7 +215,7 @@ class NetworkTests(test.BaseAdminViewTests): url = reverse('horizon:admin:networks:ports_tab', args=[network.id]) - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertTemplateUsed(res, 'horizon/common/_detail.html') ports = res.context['ports_table'].data @@ -260,7 +260,7 @@ class NetworkTests(test.BaseAdminViewTests): self.mock_tenant_quota_usages.return_value = quota_data url = reverse('horizon:admin:networks:agents_tab', args=[network.id]) - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertTemplateUsed(res, 'horizon/common/_detail.html') result_agents = res.context['agents_table'].data @@ -304,8 +304,8 @@ class NetworkTests(test.BaseAdminViewTests): {'network-ip-availability': True, 'mac-learning': mac_learning}) - url = urlunquote(reverse('horizon:admin:networks:subnets_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:admin:networks:subnets_tab', + args=[network_id])) res = self.client.get(url) redir_url = INDEX_URL @@ -349,8 +349,8 @@ class NetworkTests(test.BaseAdminViewTests): 'network_availability_zone': True}) self.mock_tenant_quota_usages.return_value = quota_data - url = urlunquote(reverse('horizon:admin:networks:subnets_tab', - args=[network.id])) + url = parse.unquote(reverse('horizon:admin:networks:subnets_tab', + args=[network.id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') @@ -401,8 +401,8 @@ class NetworkTests(test.BaseAdminViewTests): 'dhcp_agent_scheduler': True}) self.mock_tenant_quota_usages.return_value = quota_data - url = urlunquote(reverse('horizon:admin:networks:subnets_tab', - args=[network.id])) + url = parse.unquote(reverse('horizon:admin:networks:subnets_tab', + args=[network.id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') diff --git a/openstack_dashboard/dashboards/admin/snapshots/tests.py b/openstack_dashboard/dashboards/admin/snapshots/tests.py index c1f7b8cf7..e04a05e8b 100644 --- a/openstack_dashboard/dashboards/admin/snapshots/tests.py +++ b/openstack_dashboard/dashboards/admin/snapshots/tests.py @@ -11,11 +11,11 @@ # under the License. from unittest import mock +from urllib import parse from django.conf import settings from django.test.utils import override_settings from django.urls import reverse -from django.utils.http import urlunquote from openstack_dashboard.api import cinder from openstack_dashboard.api import keystone @@ -38,7 +38,7 @@ class VolumeSnapshotsViewTests(test.BaseAdminViewTests): self.mock_tenant_list.return_value = [self.tenants.list(), False] url = reverse(INDEX_URL) - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertEqual(res.status_code, 200) self.assertTemplateUsed(res, 'horizon/common/_data_table_view.html') @@ -63,7 +63,7 @@ class VolumeSnapshotsViewTests(test.BaseAdminViewTests): self.mock_volume_list.return_value = self.cinder_volumes.list() self.mock_tenant_list.return_value = [self.tenants.list(), False] - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertTemplateUsed(res, 'horizon/common/_data_table_view.html') self.assertEqual(res.status_code, 200) diff --git a/openstack_dashboard/dashboards/admin/volumes/tests.py b/openstack_dashboard/dashboards/admin/volumes/tests.py index 29a39649b..37495cad9 100644 --- a/openstack_dashboard/dashboards/admin/volumes/tests.py +++ b/openstack_dashboard/dashboards/admin/volumes/tests.py @@ -13,11 +13,11 @@ # under the License. import copy +from urllib import parse from django.conf import settings from django.test.utils import override_settings from django.urls import reverse -from django.utils.http import urlunquote from openstack_dashboard import api from openstack_dashboard.dashboards.project.volumes \ @@ -92,7 +92,7 @@ class VolumeTests(test.BaseAdminViewTests): self.mock_server_list.return_value = [self.servers.list(), False] self.mock_tenant_list.return_value = [self.tenants.list(), False] - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.mock_server_list.assert_called_once_with( test.IsHttpRequest(), search_opts={'all_tenants': True}) diff --git a/openstack_dashboard/dashboards/project/backups/tests.py b/openstack_dashboard/dashboards/project/backups/tests.py index a3616fe0b..4a93d782a 100644 --- a/openstack_dashboard/dashboards/project/backups/tests.py +++ b/openstack_dashboard/dashboards/project/backups/tests.py @@ -10,11 +10,12 @@ # License for the specific language governing permissions and limitations # under the License. +from urllib import parse + from django.conf import settings from django.test.utils import override_settings from django.urls import reverse from django.utils.http import urlencode -from django.utils.http import urlunquote from openstack_dashboard import api from openstack_dashboard.dashboards.project.backups \ @@ -39,7 +40,7 @@ class VolumeBackupsViewTests(test.TestCase): self.mock_volume_snapshot_list.return_value \ = self.cinder_volume_snapshots.list() - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertEqual(res.status_code, 200) self.assertTemplateUsed(res, 'horizon/common/_data_table_view.html') diff --git a/openstack_dashboard/dashboards/project/networks/tests.py b/openstack_dashboard/dashboards/project/networks/tests.py index 77dc74902..c6740589c 100644 --- a/openstack_dashboard/dashboards/project/networks/tests.py +++ b/openstack_dashboard/dashboards/project/networks/tests.py @@ -14,10 +14,10 @@ import collections from unittest import mock +from urllib import parse from django.urls import reverse from django.utils.html import escape -from django.utils.http import urlunquote from horizon.workflows import views @@ -209,8 +209,8 @@ class NetworkTests(test.TestCase, NetworkStubMixin): self._stub_is_extension_supported({'mac-learning': mac_learning, 'network_availability_zone': True}) - url = urlunquote(reverse('horizon:project:networks:detail', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:detail', + args=[network_id])) res = self.client.get(url) network = res.context['network'] @@ -243,8 +243,8 @@ class NetworkTests(test.TestCase, NetworkStubMixin): self._stub_is_extension_supported({'mac-learning': mac_learning, 'network_availability_zone': True}) - url = urlunquote(reverse('horizon:project:networks:subnets_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:subnets_tab', + args=[network_id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') @@ -313,8 +313,8 @@ class NetworkTests(test.TestCase, NetworkStubMixin): self._stub_is_extension_supported({'mac-learning': mac_learning, 'network_availability_zone': True}) - url = urlunquote(reverse('horizon:project:networks:subnets_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:subnets_tab', + args=[network_id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') @@ -354,8 +354,8 @@ class NetworkTests(test.TestCase, NetworkStubMixin): self._stub_is_extension_supported({'mac-learning': mac_learning, 'network_availability_zone': True}) - url = urlunquote(reverse('horizon:project:networks:subnets_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:subnets_tab', + args=[network_id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') subnets = res.context['subnets_table'].data @@ -1263,8 +1263,8 @@ class NetworkViewTests(test.TestCase, NetworkStubMixin): 'network_availability_zone': True}) self.mock_tenant_quota_usages.return_value = quota_data - url = urlunquote(reverse('horizon:project:networks:subnets_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:subnets_tab', + args=[network_id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') @@ -1335,8 +1335,8 @@ class NetworkViewTests(test.TestCase, NetworkStubMixin): 'network_availability_zone': True}) self.mock_tenant_quota_usages.return_value = quota_data - url = urlunquote(reverse('horizon:project:networks:ports_tab', - args=[network_id])) + url = parse.unquote(reverse('horizon:project:networks:ports_tab', + args=[network_id])) res = self.client.get(url) self.assertTemplateUsed(res, 'horizon/common/_detail.html') diff --git a/openstack_dashboard/dashboards/project/snapshots/tests.py b/openstack_dashboard/dashboards/project/snapshots/tests.py index c2eec55de..56d723448 100644 --- a/openstack_dashboard/dashboards/project/snapshots/tests.py +++ b/openstack_dashboard/dashboards/project/snapshots/tests.py @@ -17,11 +17,11 @@ # under the License. from unittest import mock +from urllib import parse from django.conf import settings from django.test.utils import override_settings from django.urls import reverse -from django.utils.http import urlunquote from openstack_dashboard import api from openstack_dashboard.dashboards.project.snapshots \ @@ -49,7 +49,7 @@ class VolumeSnapshotsViewTests(test.TestCase): self.mock_group_snapshot_list.return_value = \ self.cinder_volume_snapshots_with_groups.list() - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertEqual(res.status_code, 200) self.assertTemplateUsed(res, 'horizon/common/_data_table_view.html') diff --git a/openstack_dashboard/dashboards/project/volume_groups/tests.py b/openstack_dashboard/dashboards/project/volume_groups/tests.py index d80b4fb42..4d7a8ef17 100644 --- a/openstack_dashboard/dashboards/project/volume_groups/tests.py +++ b/openstack_dashboard/dashboards/project/volume_groups/tests.py @@ -11,17 +11,17 @@ # under the License. from unittest import mock +from urllib import parse from django.urls import reverse -from django.utils.http import urlunquote from openstack_dashboard.api import cinder from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizon:project:volume_groups:index') -VOLUME_GROUPS_SNAP_INDEX_URL = urlunquote(reverse( - 'horizon:project:vg_snapshots:index')) +VOLUME_GROUPS_SNAP_INDEX_URL = parse.unquote( + reverse('horizon:project:vg_snapshots:index')) class VolumeGroupTests(test.TestCase): diff --git a/openstack_dashboard/dashboards/project/volumes/tests.py b/openstack_dashboard/dashboards/project/volumes/tests.py index 37b39a41f..27ef73b5f 100644 --- a/openstack_dashboard/dashboards/project/volumes/tests.py +++ b/openstack_dashboard/dashboards/project/volumes/tests.py @@ -14,13 +14,13 @@ import copy from unittest import mock +from urllib import parse from django.conf import settings from django.forms import widgets from django.template.defaultfilters import slugify from django.test.utils import override_settings from django.urls import reverse -from django.utils.http import urlunquote from openstack_dashboard import api from openstack_dashboard.api import cinder @@ -122,7 +122,7 @@ class VolumeIndexViewTests(test.ResetImageAPIVersionMixin, test.TestCase): self.mock_tenant_absolute_limits.return_value = \ self.cinder_limits['absolute'] - res = self.client.get(urlunquote(url)) + res = self.client.get(parse.unquote(url)) self.assertEqual(2, self.mock_volume_backup_supported.call_count) self.mock_volume_list_paged.assert_called_once_with( |