horizon/openstack_dashboard/test
Janet Yu 6b9f019959 Fix addition of plugin panel to panel group
Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
class. Adding a plugin panel to a dashboard whose class has its panels defined
in a tuple will fail because the new plugin cannot be appended to the tuple.
The code errors out before the panel gets added to the dashboard's panel list.
However, at this point, the panel has already been registered with the
dashboard. This causes Dashboard.get_panels() to see the panel in its registry
but not in its panel groups. Consequently, the panel gets put in the "Other"
panel group instead of its configured one, as described in bug #1378558.

By not adding the the plugin panel to its dashboard's class, the panel gets
added to its dashboard's panel list. Now the original issue from bug #1329050
resurfaces. The root cause of that is that every time Dashboard._autodiscover()
is called, it instantiates all its panel group classes, wiping out any panels
previously added to any of the panel groups. Avoid this by always processing
all the plugin panel groups before any of the plugin panels, which also ensures
that the panel groups exist before their panels.

Making this change exposed an issue where the Horizon URLs were being loaded
twice during the plugin infrastructure's unit tests, causing plugin panels to
be added multiple times to their dashboards. Fix that by removing the second,
unnecessary call. Also create a second test plugin panel group and panel to
test the scenarios described in the two bugs addressed here, adding two panel
groups at a time.

Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
Closes-Bug: 1378558
(cherry picked from commit e2ef492311)
(cherry picked from commit 5c1604275b)
2015-06-18 18:12:02 +02:00
..
api_tests Show ports from shared nets in floating IP assoc 2015-03-18 07:17:03 -07:00
integration_tests Merge "Adds keypair create,delete integration tests" 2014-08-15 01:51:59 +00:00
templates Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
test_data Display only reachable IP as Floating IP association target 2014-10-01 05:55:06 +00:00
test_panels Fix addition of plugin panel to panel group 2015-06-18 18:12:02 +02:00
test_plugins Fix addition of plugin panel to panel group 2015-06-18 18:12:02 +02:00
tests Fix order of arguments in assertEqual 2014-09-01 10:41:52 +08:00
__init__.py Revamp of testing machinery. 2012-04-23 22:24:21 -07:00
error_pages_urls.py Remove #noqa from two common imports and add them to import_exceptions 2014-09-16 14:08:28 +04:00
helpers.py Fix addition of plugin panel to panel group 2015-06-18 18:12:02 +02:00
settings.py Workaround for 'File exists' test failure 2014-09-30 06:43:22 -05:00