Commit Graph

8 Commits

Author SHA1 Message Date
Akihiro Motoki 7052b7f065 Address RemovedInDjango40Warning (7)
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
2022-02-04 16:27:32 +09:00
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Simon Merrick 2735f2c08d Add support for multiple swift storage policies
+ Adds endpoint for listing available policies
+ Support to select a storage policy for new containers
+ Display container storage polcy on dashboard.

Change-Id: I588452fd5d6417859f5dd19ccedcb18f420ab646
2020-04-16 22:18:06 +12: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
Akihiro Motoki 58019a7411 Disable mox usage by default in test helper
- 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>
2018-04-20 03:34:51 +00:00
Akihiro Motoki 3e409d8b98 Improve mocking in REST API tests (test_swift)
The current REST API tests have a lot of rooms to be improved like:
- mocking the whole module of the API wrapper
- Unnecesary setUp()
- Test data should not be accessed directly via TestData

This commit improves test/unit/api/rest/test_swift.py.

Change-Id: I3532abee7febafea0f4cdc6ebfcc62f3cecd52eb
Partial-Bug: #1752917
2018-03-22 11:02:44 +09:00
Akihiro Motoki 5c5159bc09 Switch swift API tests to mock
This patch changes mox to mock for the following test modules:
* openstack_dashboard/test/unit/api/test_swift.py
* openstack_dashboard/test/unit/api/rest/test_swift.py

Partially-Implements: blueprint mock-framework-in-unit-tests

Change-Id: I3c920564b781c9c1c97bd6ee22b834504c94cb60
2018-02-16 13:25:45 +00:00
Akihiro Motoki f3af02f20f openstack_dashboard: Move test files to match module structure
This commit relocates test codes in openstack_dashboard
according to blueprint relocation-test-codes.

Change-Id: I397a5a47fe9c1bf3a498c22056d924bf409c514b
2017-12-09 21:38:06 +09:00