示例#1
0
 def tearDown(self):
     # Restore dash
     cats = horizon.get_dashboard("cats")
     cats.name = "Cats"
     horizon.register(Dogs)
     self._discovered_dashboards.append(Dogs)
     Dogs.register(Puppies)
     Cats.register(Tigers)
     super(CustomPanelTests, self).tearDown()
     settings.HORIZON_CONFIG.pop('customization_module')
     # refresh config
     conf.HORIZON_CONFIG._setup()
示例#2
0
 def tearDown(self):
     # Restore dash
     cats = horizon.get_dashboard("cats")
     cats.name = "Cats"
     horizon.register(Dogs)
     self._discovered_dashboards.append(Dogs)
     Dogs.register(Puppies)
     Cats.register(Tigers)
     super(CustomPanelTests, self).tearDown()
     settings.HORIZON_CONFIG.pop('customization_module')
     # refresh config
     conf.HORIZON_CONFIG._setup()
示例#3
0
 def setUp(self):
     super(BaseHorizonTests, self).setUp()
     # Adjust our horizon config and register our custom dashboards/panels.
     self.old_default_dash = settings.HORIZON_CONFIG['default_dashboard']
     settings.HORIZON_CONFIG['default_dashboard'] = 'cats'
     self.old_dashboards = settings.HORIZON_CONFIG['dashboards']
     settings.HORIZON_CONFIG['dashboards'] = ('cats', 'dogs')
     base.Horizon.register(Cats)
     base.Horizon.register(Dogs)
     Cats.register(Kittens)
     Cats.register(Tigers)
     Dogs.register(Puppies)
     # Trigger discovery, registration, and URLconf generation if it
     # hasn't happened yet.
     base.Horizon._urls()
     # Store our original dashboards
     self._discovered_dashboards = list(base.Horizon._registry)
     # Gather up and store our original panels for each dashboard
     self._discovered_panels = {}
     for dash in self._discovered_dashboards:
         panels = list(base.Horizon._registry[dash]._registry)
         self._discovered_panels[dash] = panels
示例#4
0
 def setUp(self):
     super(BaseHorizonTests, self).setUp()
     # Adjust our horizon config and register our custom dashboards/panels.
     self.old_default_dash = settings.HORIZON_CONFIG['default_dashboard']
     settings.HORIZON_CONFIG['default_dashboard'] = 'cats'
     self.old_dashboards = settings.HORIZON_CONFIG['dashboards']
     settings.HORIZON_CONFIG['dashboards'] = ('cats', 'dogs')
     base.Horizon.register(Cats)
     base.Horizon.register(Dogs)
     Cats.register(Kittens)
     Cats.register(Tigers)
     Dogs.register(Puppies)
     # Trigger discovery, registration, and URLconf generation if it
     # hasn't happened yet.
     base.Horizon._urls()
     # Store our original dashboards
     self._discovered_dashboards = base.Horizon._registry.keys()
     # Gather up and store our original panels for each dashboard
     self._discovered_panels = {}
     for dash in self._discovered_dashboards:
         panels = base.Horizon._registry[dash]._registry.keys()
         self._discovered_panels[dash] = panels
示例#5
0
 def setUp(self):
     super(RbacHorizonTests, self).setUp()
     # Adjust our horizon config and register our custom dashboards/panels.
     self.old_default_dash = settings.HORIZON_CONFIG['default_dashboard']
     settings.HORIZON_CONFIG['default_dashboard'] = 'cats'
     self.old_dashboards = settings.HORIZON_CONFIG['dashboards']
     settings.HORIZON_CONFIG['dashboards'] = ('cats', 'dogs')
     base.Horizon.register(Cats)
     base.Horizon.register(Dogs)
     Cats.register(RbacNoAccessPanel)
     Cats.default_panel = 'rbac_panel_no'
     Dogs.register(RbacYesAccessPanel)
     Dogs.default_panel = 'rbac_panel_yes'
     # Trigger discovery, registration, and URLconf generation if it
     # hasn't happened yet.
     base.Horizon._urls()
     # Store our original dashboards
     self._discovered_dashboards = base.Horizon._registry.keys()
     # Gather up and store our original panels for each dashboard
     self._discovered_panels = {}
     for dash in self._discovered_dashboards:
         panels = base.Horizon._registry[dash]._registry.keys()
         self._discovered_panels[dash] = panels
示例#6
0
 def setUp(self):
     super(RbacHorizonTests, self).setUp()
     # Adjust our horizon config and register our custom dashboards/panels.
     self.old_default_dash = settings.HORIZON_CONFIG['default_dashboard']
     settings.HORIZON_CONFIG['default_dashboard'] = 'cats'
     self.old_dashboards = settings.HORIZON_CONFIG['dashboards']
     settings.HORIZON_CONFIG['dashboards'] = ('cats', 'dogs')
     base.Horizon.register(Cats)
     base.Horizon.register(Dogs)
     Cats.register(RbacNoAccessPanel)
     Cats.default_panel = 'rbac_panel_no'
     Dogs.register(RbacYesAccessPanel)
     Dogs.default_panel = 'rbac_panel_yes'
     # Trigger discovery, registration, and URLconf generation if it
     # hasn't happened yet.
     base.Horizon._urls()
     # Store our original dashboards
     self._discovered_dashboards = list(base.Horizon._registry)
     # Gather up and store our original panels for each dashboard
     self._discovered_panels = {}
     for dash in self._discovered_dashboards:
         panels = list(base.Horizon._registry[dash]._registry)
         self._discovered_panels[dash] = panels