def init_glsettings_for_unit_tests(): Settings.testing = True Settings.set_devel_mode() Settings.logging = None Settings.failed_login_attempts = 0 Settings.working_path = './working_path' Settings.eval_paths() Settings.set_ramdisk_path() Settings.remove_directories() Settings.create_directories() State.orm_tp = FakeThreadPool() State.tenant_cache[1].hostname = 'localhost' Sessions.clear()
def init_state(): Settings.testing = True Settings.set_devel_mode() Settings.logging = None Settings.failed_login_attempts = 0 Settings.working_path = './working_path' Settings.eval_paths() if os.path.exists(Settings.working_path): dir_util.remove_tree(Settings.working_path, 0) orm.set_thread_pool(FakeThreadPool()) State.settings.enable_api_cache = False State.tenant_cache[1] = ObjectDict() State.tenant_cache[1].hostname = 'www.globaleaks.org' State.init_environment() Sessions.clear()
def initialization(self): # we need to reset settings.session to keep each test independent Sessions.clear() # we need to reset ApiCache to keep each test independent ApiCache.invalidate()