diff --git a/openstack_dashboard/test/test_panels/plugin_panel/static/plugin_panel/plugin.scss b/openstack_dashboard/test/test_panels/plugin_panel/static/plugin_panel/plugin.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstack_dashboard/test/test_panels/plugin_panel/static/plugin_panel/plugin.spec.js b/openstack_dashboard/test/test_panels/plugin_panel/static/plugin_panel/plugin.spec.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstack_dashboard/test/test_plugins/panel_config/_10_admin_add_panel.py b/openstack_dashboard/test/test_plugins/panel_config/_10_admin_add_panel.py index 0de8ee681c..543e383171 100644 --- a/openstack_dashboard/test/test_plugins/panel_config/_10_admin_add_panel.py +++ b/openstack_dashboard/test/test_plugins/panel_config/_10_admin_add_panel.py @@ -17,3 +17,9 @@ ADD_ANGULAR_MODULES = ['testAngularModule'] # A list of javascript files to be included in the compressed set of files ADD_JS_FILES = ['plugin_panel/plugin_module.js'] + +# A list of scss files to be included in the compressed set of files +ADD_JS_SPEC_FILES = ['plugin_panel/plugin.spec.js'] + +# A list of scss files to be included in the compressed set of files +ADD_SCSS_FILES = ['plugin_panel/plugin.scss'] \ No newline at end of file diff --git a/openstack_dashboard/test/test_plugins/panel_tests.py b/openstack_dashboard/test/test_plugins/panel_tests.py index 83afb2612a..f9ab824fb6 100644 --- a/openstack_dashboard/test/test_plugins/panel_tests.py +++ b/openstack_dashboard/test/test_plugins/panel_tests.py @@ -21,7 +21,7 @@ from openstack_dashboard.dashboards.admin.info import panel as info_panel from openstack_dashboard.test import helpers as test from openstack_dashboard.test.test_panels.plugin_panel \ import panel as plugin_panel -import openstack_dashboard.test.test_plugins.panel_config +from openstack_dashboard.test.test_plugins import panel_config from openstack_dashboard.utils import settings as util_settings @@ -33,9 +33,7 @@ INSTALLED_APPS = list(settings.INSTALLED_APPS) HORIZON_CONFIG.pop('dashboards', None) HORIZON_CONFIG.pop('default_dashboard', None) -util_settings.update_dashboards([ - openstack_dashboard.test.test_plugins.panel_config, -], HORIZON_CONFIG, INSTALLED_APPS) +util_settings.update_dashboards([panel_config,], HORIZON_CONFIG, INSTALLED_APPS) @override_settings(HORIZON_CONFIG=HORIZON_CONFIG, @@ -50,6 +48,11 @@ class PanelPluginTests(test.PluginTestCase): # Check that the panel is in its configured panel group. self.assertIn(plugin_panel.PluginPanel, [p.__class__ for p in panel_group]) + # Ensure that static resources are properly injected + pc = panel_config._10_admin_add_panel + self.assertEquals(pc.ADD_JS_FILES, HORIZON_CONFIG['js_files']) + self.assertEquals(pc.ADD_JS_SPEC_FILES, HORIZON_CONFIG['js_spec_files']) + self.assertEquals(pc.ADD_SCSS_FILES, HORIZON_CONFIG['scss_files']) def test_remove_panel(self): dashboard = horizon.get_dashboard("admin")