horizon/horizon/test
Akihiro Motoki a96e632bf5 Avoid duplicated message in Batch/DeleteAction
Previously BatchAction.handle() automatically adds an error message
when handle() method raises an exception. If some custom error message
is shown in handle() method, two error messages will be shown.

This commit allows a special handling for HandledException to
BatchAction.handle(). In individual BatchAction instances,
handle() method can now show a custom error message and raise an
HandledException, and then BatchAction.handle() skips to show an
error message for that. The reason of using HandledException is
because the exception can be raised from exceptions.handle() function
which is commonly used to handle exceptions.

The common pattern in handle() would be:

 try:
    <do something>
 except Exception as e:
    # HandledException which wrapps the original exception will be raised.
    # HandledException will be caught by BatchAction.handle().
    exceptions.handle(request, msg, escalate=True)

To make it easier to use the pattern, a new decorator
horizon.tables.actions.handle_exception_with_detail_message is introduced.

Partial-Bug: #1733207
Change-Id: I4bb0f61c7b63ea6ecd2e30c03eddecee62ff9b13
2018-01-23 22:46:25 +09:00
..
customization Fixed typos in comment for renaming dashboard 2015-09-08 18:05:02 +05:30
dummy_auth Fix horizon/test selenium tests for Django 1.8 2015-09-30 16:41:30 +10:00
jasmine Applying auto-file-discovery partially 2015-06-29 16:04:14 -06:00
messages Add message of the day option 2016-01-22 11:31:36 -08:00
selenium horizon: Move test files to match corresponding module structure 2017-12-09 21:37:12 +09:00
templates Horizon Spinner/Loader should inherit from theme 2017-04-21 11:15:52 -07:00
test_dashboards hacking: noqa cleanup in horizon 2017-03-17 19:38:47 +00:00
unit Avoid duplicated message in Batch/DeleteAction 2018-01-23 22:46:25 +09:00
__init__.py Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
firefox_binary.py Fix docstring warnings 2016-09-24 20:44:48 +09:00
helpers.py Fixes to allow us to use Django 1.11 2017-07-20 01:08:56 +12:00
settings.py Make nosehtmloutput an optional test requirement 2017-08-21 15:25:44 +02:00
urls.py hacking: noqa cleanup in horizon 2017-03-17 19:38:47 +00:00
utils.py Fix H405 (multi line docstring) warnings (horizon) 2017-06-09 16:04:57 +00:00
webdriver.py Fix H405 (multi line docstring) warnings (horizon) 2017-06-09 16:04:57 +00:00