<s> import copy <EOL> from django . conf import settings <EOL> from django . test . utils import override_settings <EOL> import horizon <EOL> from openstack_dashboard . dashboards . admin . info import panel as info_panel <EOL> from openstack_dashboard . test import helpers as test <EOL> from openstack_dashboard . test . test_panels . plugin_panel import panel as plugin_panel <EOL> from openstack_dashboard . test . test_panels . nonloading_panel import panel as nonloading_panel <EOL> from openstack_dashboard . test . test_plugins import panel_config <EOL> from openstack_dashboard . utils import settings as util_settings <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> HORIZON_CONFIG . pop ( '<STR_LIT>' , None ) <EOL> HORIZON_CONFIG . pop ( '<STR_LIT>' , None ) <EOL> HORIZON_CONFIG . pop ( '<STR_LIT>' , None ) <EOL> util_settings . update_dashboards ( [ panel_config , ] , HORIZON_CONFIG , INSTALLED_APPS ) <EOL> @ override_settings ( HORIZON_CONFIG = HORIZON_CONFIG , <EOL> INSTALLED_APPS = INSTALLED_APPS ) <EOL> class PanelPluginTests ( test . PluginTestCase ) : <EOL> def test_add_panel ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> panel_group = dashboard . get_panel_group ( '<STR_LIT>' ) <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> pc = panel_config . _10_admin_add_panel <EOL> self . assertEqual ( pc . ADD_JS_FILES , HORIZON_CONFIG [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( pc . ADD_JS_SPEC_FILES , HORIZON_CONFIG [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( pc . ADD_SCSS_FILES , HORIZON_CONFIG [ '<STR_LIT>' ] ) <EOL> def test_remove_panel ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> panel_group = dashboard . get_panel_group ( '<STR_LIT>' ) <EOL> self . assertNotIn ( info_panel . Info , <EOL> [ p . __class__ for p in dashboard . get_panels ( ) ] ) <EOL> self . assertNotIn ( info_panel . Info , <EOL> [ p . __class__ for p in panel_group ] ) <EOL> def test_default_panel ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> self . assertEqual ( '<STR_LIT>' , dashboard . default_panel ) <EOL> def test_panel_not_added ( self ) : <EOL> dashboard = horizon . get_dashboard ( "<STR_LIT>" ) <EOL> self . assertNotIn ( nonloading_panel . NonloadingPanel , <EOL> [ p . __class__ for p in dashboard . get_panels ( ) ] ) </s>
