Commit Graph

11 Commits

Author SHA1 Message Date
Akihiro Motoki e4444e6979 Address RemovedInDjango40Warning (4)
In Django 3.0, django.utils.http.urlquote(), urlquote_plus(),
urlunquote(), and urlunquote_plus() are deprecated in favor of
the functions that they’re aliases for: urllib.parse.quote(),
quote_plus(), unquote(), and unquote_plus().

https: //docs.djangoproject.com/en/4.0/releases/3.0/
Change-Id: I37fcd917cbf87b4d3141cfbdd2675aa38f33f2a4
2022-02-04 16:27:18 +09:00
Ivan Kolodyazhny 14e779bbac Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I2de669d8e89b8daeb7ee5405ffab35af6307c40b
2020-03-26 19:45:37 +02:00
Ivan Kolodyazhny e976461d85 Remove six usage from horizon package
We don't support Python 2 anymore so we don't need this
compatibility library.

six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.

This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.

Change-Id: I0b567382edf4d68674a7b8d0b02333fb57293958
2020-01-15 12:36:11 +02:00
wangliangyu a9d6c7886c Make update status dialog less confusing
Now, we give the init status of the volume when resetting status.
The first glance is the current status, instead of "Select an
new status", and we could do nothing with the status will confuse user.
The same with snapshot.

According to the above situation and Akihiro's suggestion:
 - Use "Select on new status" as the default label
 - List all possible values for status *including the current status*
 - Add "(current)" to the current value in the dropdown list

Change-Id: I61e642e2fd8ddd7498911272678e57b60b60a3b8
Closes-Bug: #1803475
2018-11-22 20:42:24 +09:00
Akihiro Motoki a0e4508c97 Fix confusing variable names in unit tests
mox_**** was used to store test data.
It is confusing and meaningless.
This commit fixes the usage.

Related to blueprint mock-framework-in-unit-tests

Change-Id: I35a13020962999c3f5b550208e6f0b82bf1648b6
2018-08-18 17:15:59 +09:00
Akihiro Motoki a70e1f462e Convert admin.snapshots tests into mock
blueprint mock-framework-in-unit-tests
Change-Id: I907697d10e9674c2838e7d3c1ca8a3e66db523dd
2018-03-15 22:53:35 +09:00
Akihiro Motoki e477eafa45 django2: 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

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
wei.ying a27753153b Fix AttributeError in project/admin snapshot detail page
If click the name link and go into the details page for the snapshot,
the snapshot object lose the property of volume. It will be thrown an
exception in the console.

AttributeError: 'VolumeSnapshot' object has no attribute '_volume'

Change-Id: I365992a9f784af293f40d74e0f80828d9a7e699b
Closes-Bug: #1695719
2017-06-06 22:31:32 +08:00
Julie Gravel 74cfb5d9af Fix Status dropdown initial value
The value of Status dropdown on Admin > Volume > Volumes > Update Volume
Status and Admin > Volume > Snapshots > Update Status forms were initially
set with the raw data instead of the localized version of the value. This
fix changes the initial value to the localized version and also updates
localized statuses to use values from
project.volumes.tables.VolumesTableBase.STATUS_DISPLAY_CHOICES.

Closes-Bug: #1626343
Change-Id: I1ac58e2eb7b4a8d4894280285a824d280fafd531
2017-05-15 12:37:03 -07:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Richard Jones e89c377599 Move Admin Volume Snapshots out of tabbed panel
Change-Id: I8c569a0d0fa5e990524012cacee50f9a249aa5e1
Implements: blueprint reorganise-volumes
2017-03-09 13:47:31 +11:00