Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Remove os.environ from wireup.billing #2233

Merged
merged 1 commit into from
Apr 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure-aspen.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
env = website.env = gittip.wireup.env()
gittip.wireup.canonical(env)
website.db = gittip.wireup.db(env)
gittip.wireup.billing()
gittip.wireup.billing(env)
gittip.wireup.username_restrictions(website)
gittip.wireup.nanswers(env)
gittip.wireup.accounts_elsewhere(website, env)
Expand Down
8 changes: 4 additions & 4 deletions gittip/wireup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def db(env):
return db


def billing():
stripe.api_key= os.environ['STRIPE_SECRET_API_KEY']
stripe.publishable_api_key= os.environ['STRIPE_PUBLISHABLE_API_KEY']
balanced.configure(os.environ['BALANCED_API_SECRET'])
def billing(env):
stripe.api_key = env.stripe_secret_api_key
stripe.publishable_api_key = env.stripe_publishable_api_key
balanced.configure(env.balanced_api_secret)


def username_restrictions(website):
Expand Down
4 changes: 2 additions & 2 deletions tests/py/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Tests(Harness):
def setUp(self):
Harness.setUp(self)

# Grab configuration from os.environ, storing for later.
env = Environment(CANONICAL_SCHEME=unicode, CANONICAL_HOST=unicode)
# Grab configuration from the environment, storing for later.
env = wireup.env()
self.environ = env.environ

# Change env, doesn't change self.environ.
Expand Down
3 changes: 2 additions & 1 deletion tests/py/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def test_stats_description_accurate_during_payday_run(self):
with patch.object(datetime, 'datetime') as mock_datetime:
mock_datetime.utcnow.return_value = a_thursday

wireup.billing()
env = wireup.env()
wireup.billing(env)
payday = Payday(self.db)
payday.start()

Expand Down