Example #1
0
 def environment_created(self):
     for table in db_default.schema:
         create_table(self.env, table)
     
     cache_manager = HttpRequestCacheManager(self.env)
     po_manager = PersistentObjectManager(self.env)
     for manager in cache_manager.managers:
         model_class = manager.for_model()
         if issubclass(model_class, PersistentObject):
             module_name = model_class.__module__
             # We don't want to create tables for dummy classes automatically
             # but the test finder may load some of these managers so we
             # need to exclude them here.
             if ('tests.' not in module_name):
                 po_manager.create_table(model_class)
     
     # Need to create Agilo types in the database before writing to the 
     # configuration - otherwise we get a warning during config setup (you'll
     # see it in every test case during setUp)
     db_default.create_default_types(self.env)
     initialize_config(self.env, __CONFIG_PROPERTIES__)
     db_default.create_default_backlogs(self.env)
     super(AgiloInit, self).environment_created()
     for listener in self.setup_listeners:
         listener.agilo_was_installed()
     # Reload the AgiloConfig to make sure all the changes have been updated
     AgiloConfig(self.env).reload()
     info(self, 'Agilo environment initialized')
Example #2
0
    def environment_created(self):
        for table in db_default.schema:
            create_table(self.env, table)

        cache_manager = HttpRequestCacheManager(self.env)
        po_manager = PersistentObjectManager(self.env)
        for manager in cache_manager.managers:
            model_class = manager.for_model()
            if issubclass(model_class, PersistentObject):
                module_name = model_class.__module__
                # We don't want to create tables for dummy classes automatically
                # but the test finder may load some of these managers so we
                # need to exclude them here.
                if ('tests.' not in module_name):
                    po_manager.create_table(model_class)

        # Need to create Agilo types in the database before writing to the
        # configuration - otherwise we get a warning during config setup (you'll
        # see it in every test case during setUp)
        db_default.create_default_types(self.env)
        initialize_config(self.env, __CONFIG_PROPERTIES__)
        db_default.create_default_backlogs(self.env)
        super(AgiloInit, self).environment_created()
        for listener in self.setup_listeners:
            listener.agilo_was_installed()
        # Reload the AgiloConfig to make sure all the changes have been updated
        AgiloConfig(self.env).reload()
        info(self, 'Agilo environment initialized')
Example #3
0
 def test_doesnt_overwrite_custom_favicons(self):
     custom_favicon = 'fnord'
     project_section = AgiloConfig(self.env).get_section('project')
     project_section.change_option('icon', custom_favicon)
     self.assert_equals(custom_favicon, project_section.get('icon'))
     
     initialize_config(self.env, {})
     project_section = AgiloConfig(self.env).get_section('project')
     self.assert_equals(custom_favicon, project_section.get('icon'))
Example #4
0
def _update_configuration(env):
    my_config = copy(__CONFIG_PROPERTIES__)
    del my_config[AgiloConfig.AGILO_LINKS]
    del my_config[AgiloConfig.AGILO_TYPES]
    initialize_config(env, my_config)

    config = AgiloConfig(env).tc  # Only the trac config wrapper
    _update_agilo_types(config)
    _update_calculated_properties(config, env)
Example #5
0
    def test_doesnt_overwrite_custom_favicons(self):
        custom_favicon = 'fnord'
        project_section = AgiloConfig(self.env).get_section('project')
        project_section.change_option('icon', custom_favicon)
        self.assert_equals(custom_favicon, project_section.get('icon'))

        initialize_config(self.env, {})
        project_section = AgiloConfig(self.env).get_section('project')
        self.assert_equals(custom_favicon, project_section.get('icon'))
Example #6
0
def _update_configuration(env):
    my_config = copy(__CONFIG_PROPERTIES__)
    del my_config[AgiloConfig.AGILO_LINKS]
    del my_config[AgiloConfig.AGILO_TYPES]
    initialize_config(env, my_config)
    
    config = AgiloConfig(env).tc # Only the trac config wrapper
    _update_agilo_types(config)
    _update_calculated_properties(config, env)