def setUp(self): Harness.setUp(self) # Grab configuration from the environment, storing for later. env = wireup.env() self.environ = env.environ # Change env, doesn't change self.environ. env.canonical_scheme = 'https' env.canonical_host = 'example.com' wireup.canonical(env)
def tearDown(self): Harness.tearDown(self) reset = Environment(CANONICAL_SCHEME=unicode, CANONICAL_HOST=unicode, environ=self.environ) wireup.canonical(reset)
'assert': _assert, 'Community': Community, 'b64decode': base64.b64decode, 'b64encode': base64.b64encode, 'filter_profile_subnav': utils.filter_profile_subnav, 'to_javascript': utils.to_javascript, 'urlquote': urlquote, }) # Wireup Algorithm # ================ env = website.env = wireup.env() tell_sentry = website.tell_sentry = wireup.make_sentry_teller(env) wireup.canonical(env) website.db = wireup.db(env) website.mailer = wireup.mail(env, website.project_root) wireup.billing(env) wireup.username_restrictions(website) wireup.load_i18n(website.project_root, tell_sentry) wireup.other_stuff(website, env) wireup.accounts_elsewhere(website, env) # Periodic jobs # ============= cron = Cron(website) cron(env.update_global_stats_every, lambda: utils.update_global_stats(website)) cron(env.check_db_every, website.db.self_check, True)
'b64encode': base64.b64encode, 'filter_profile_subnav': utils.filter_profile_subnav, 'to_javascript': utils.to_javascript, 'urlquote': urlquote, }) # Wireup Algorithm # ================ env = website.env = wireup.env() tell_sentry = website.tell_sentry = wireup.make_sentry_teller(env) wireup.canonical(env) website.db = wireup.db(env) website.mailer = wireup.mail(env, website.project_root) wireup.billing(env) wireup.username_restrictions(website) wireup.load_i18n(website.project_root, tell_sentry) wireup.other_stuff(website, env) wireup.accounts_elsewhere(website, env) # Periodic jobs # ============= cron = Cron(website) cron(env.update_global_stats_every, lambda: utils.update_global_stats(website)) cron(env.check_db_every, website.db.self_check, True) cron(env.dequeue_emails_every, Participant.dequeue_emails, True)