<s> import copy <EOL> from django . conf import settings <EOL> from django . test . utils import override_settings <EOL> import horizon <EOL> from openstack_dashboard . test import helpers as test <EOL> from openstack_dashboard . test . test_panels . another_panel import panel as another_panel <EOL> from openstack_dashboard . test . test_panels . plugin_panel import panel as plugin_panel <EOL> from openstack_dashboard . test . test_panels . second_panel import panel as second_panel <EOL> import openstack_dashboard . test . test_plugins . panel_group_config <EOL> from openstack_dashboard . utils import settings as util_settings <EOL> PANEL_GROUP_SLUG = '<STR_LIT>' <EOL> SECOND_PANEL_GROUP_SLUG = '<STR_LIT>' <EOL> HORIZON_CONFIG = copy . deepcopy ( settings . HORIZON_CONFIG ) <EOL> INSTALLED_APPS = list ( settings . INSTALLED_APPS ) <EOL> HORIZON_CONFIG . pop ( '<STR_LIT>' , None ) <EOL> HORIZON_CONFIG . pop ( '<STR_LIT>' , None ) <EOL> util_settings . update_dashboards ( [ <EOL> openstack_dashboard . test . test_plugins . panel_group_config , <EOL> ] , HORIZON_CONFIG , INSTALLED_APPS ) <EOL> @ override_settings ( HORIZON_CONFIG = HORIZON_CONFIG , <EOL> INSTALLED_APPS = INSTALLED_APPS ) <EOL> class PanelGroupPluginTests ( test . PluginTestCase ) : <EOL> def test_add_panel_group ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> self . assertIsNotNone ( dashboard . get_panel_group ( PANEL_GROUP_SLUG ) ) <EOL> def test_add_second_panel_group ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> self . assertIsNotNone ( <EOL> dashboard . get_panel_group ( SECOND_PANEL_GROUP_SLUG ) ) <EOL> def test_add_panel ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> panel_group = dashboard . get_panel_group ( PANEL_GROUP_SLUG ) <EOL> self . assertIn ( plugin_panel . PluginPanel , <EOL> [ p . __class__ for p in dashboard . get_panels ( ) ] ) <EOL> self . assertIn ( plugin_panel . PluginPanel , <EOL> [ p . __class__ for p in panel_group ] ) <EOL> def test_add_second_panel ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> second_panel_group = dashboard . get_panel_group ( SECOND_PANEL_GROUP_SLUG ) <EOL> self . assertIn ( second_panel . SecondPanel , <EOL> [ p . __class__ for p in dashboard . get_panels ( ) ] ) <EOL> self . assertIn ( second_panel . SecondPanel , <EOL> [ p . __class__ for p in second_panel_group ] ) <EOL> def test_unregistered_panel_group ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> self . assertIsNone ( dashboard . get_panel_group ( "<STR_LIT>" ) ) <EOL> def test_add_panel_to_default_panel_group ( self ) : <EOL> dashboard = horizon . get_dashboard ( '<STR_LIT>' ) <EOL> default_panel_group = dashboard . get_panel_group ( '<STR_LIT:default>' ) <EOL> self . assertIsNotNone ( default_panel_group ) <EOL> self . assertIn ( another_panel . AnotherPanel , <EOL> [ p . __class__ for p in default_panel_group ] ) </s>
