Exemplo n.º 1
0
    def tearDown(self):
        super(RbacHorizonTests, self).tearDown()
        # Restore our settings
        settings.HORIZON_CONFIG['default_dashboard'] = self.old_default_dash
        settings.HORIZON_CONFIG['dashboards'] = self.old_dashboards
        # Destroy our singleton and re-create it.
        base.HorizonSite._instance = None
        del base.Horizon
        base.Horizon = base.HorizonSite()
        # Reload the convenience references to Horizon stored in __init__
        moves.reload_module(import_module("horizon"))

        # Reset Cats and Dogs default_panel to default values
        Cats.default_panel = 'kittens'
        Dogs.default_panel = 'puppies'

        # Re-register our original dashboards and panels.
        # This is necessary because autodiscovery only works on the first
        # import, and calling reload introduces innumerable additional
        # problems. Manual re-registration is the only good way for testing.
        self._discovered_dashboards.remove(Cats)
        self._discovered_dashboards.remove(Dogs)
        for dash in self._discovered_dashboards:
            base.Horizon.register(dash)
            for panel in self._discovered_panels[dash]:
                dash.register(panel)
Exemplo n.º 2
0
 def tearDown(self):
     super(PanelPluginTests, self).tearDown()
     conf.HORIZON_CONFIG = self.old_horizon_config
     # Destroy our singleton and re-create it.
     base.HorizonSite._instance = None
     del base.Horizon
     base.Horizon = base.HorizonSite()
     self._reload_urls()
Exemplo n.º 3
0
 def tearDown(self):
     super(BaseHorizonTests, self).tearDown()
     # Destroy our singleton and re-create it.
     base.HorizonSite._instance = None
     del base.Horizon
     base.Horizon = base.HorizonSite()
     # Reload the convenience references to Horizon stored in __init__
     reload(import_module("horizon"))
     # Re-register our original dashboards and panels.
     # This is necessary because autodiscovery only works on the first
     # import, and calling reload introduces innumerable additional
     # problems. Manual re-registration is the only good way for testing.
     for dash in self._discovered_dashboards:
         base.Horizon.register(dash)
         for panel in self._discovered_panels[dash]:
             dash.register(panel)