HttpRequest.is_ajax() was marked as deprecated since Django 3.1 and will be
removed in Django 4.0 [1].
While the current implementation of is_ajax() relies on a jQuery-specific way
of signifying AJAX as noted in the Django relnotes, horizon works with this.
Thus this commit copies the existing logic of HttpRequest.is_ajax() to the
horizon repo (as horizon.utils.http.is_ajax()) and consumes it.
https: //docs.djangoproject.com/en/4.0/releases/3.1/#features-deprecated-in-3-1
Change-Id: I3def53033524985818a891a1b9d4659fad4ba2ba
Cinder v2 API is deprecated since pike release. Along with the removal
of cinder v2 API support in cinderclient (change I335db5c1799e drops
v2 support), this commit drops cinder v2 support in horizon.
The next release of python-cinderclient drops v2 support,
so horizon needs to use v3 classes.
Includes a workaround in unit tests for two cinderclient.v3 classes
that are missing in the cinderclient releases prior to 8.0.0. The
workaround can be removed once cinderclient change I335db5c1799edb2
is merged and released.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Iab0f097fab6696462572dc6ea53767c91e5411b1
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
Keystone V2 API was deprecated in Stein release in Horizon and
removed from Keystone in Queens release.
Change-Id: I917e273d3174adf0874e516b3d635ccb8ba58a27
pylint complains 'name' argument is redundant
in positional and keyword arguments.
The existence of 'name' in kwargs is checked before passing to
api.keystone.tenant_create, so we can pass 'name' as part of kwargs.
Change-Id: Ice09cecb21217b042d44a8c1dda7a4736e2b391b
Fix the following new errors:
* E305 expected 2 blank lines after class or function definition, found 1
* E126 continuation line over-indented for hanging indent
max_line_length is set to 80 as the default value in pycodestyle is 79
but horizon uses 80 as max_line_length.
Ignore W504 and F405 by configurations.
Reasons of disabling them are explained as comments in tox.ini.
Change-Id: Iee8bcd60c30883fc8c74f08cf20af853cbb5e271
Add filtration for service catalog. Now all endpoints that are not
public will not be seen.
Change-Id: I6db214f849d13c4c71e176f00113e889ff2d2997
Closes-Bug: #1798832
- Add use_mox = True to tests which still depend on mox
- Remove use_mox = False from all tests converted into mock
- Update the warning messages
- Replace 'S'-release with 'Stein'
Part of blueprint mock-framework-in-unit-tests
Change-Id: I208185e97b2de346304a09643a9cb3f1425a7683
Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
When a member role user go to angular users panel, it will be
raised unauthorized exception since the user has no access to
get users list. It should be add a policy check mechanism at
the panel.
Change-Id: I9cfa1aeab27aca1631322d8c0b3e6a7a930d9cfe
Closes-Bug: #1694127
The current REST API tests have a lot of rooms to be improved like:
- mocking the whole module of the API wrapper
Change-Id: I799b0bce11bb06f6da64b8cc76f490f644fd457f
Partial-Bug: #1752917
This patch changes mox to mock for the following test modules:
* openstack_dashboard/test/unit/api/test_keystone.py
* openstack_dashboard/test/unit/api/rest/test_keystone.py
Partially-Implements: blueprint mock-framework-in-unit-tests
Change-Id: I5b57bd46359466ee28bff1531c8a9bfd93842ebe
- fix users rest API to handle description,
project, and enabled attribute properly
- fix hz-password-match to work, but also so
it uses model-based checks rather than HTML
element lookups
- add schema form password-confirm type
To Test
- set 'users_panel': True in settings.py
Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Shu Muto <shu-mutou@rf.jp.nec.com>
Change-Id: I2e8f5ac1dbfae9634fa5b72f7f6c0278d5a81249
Partially-Implements: blueprint ng-users
This commit relocates test codes in openstack_dashboard
according to blueprint relocation-test-codes.
Change-Id: I397a5a47fe9c1bf3a498c22056d924bf409c514b