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

Commit

Permalink
Merge pull request #2233 from gittip/env-billing
Browse files Browse the repository at this point in the history
Remove os.environ from wireup.billing
  • Loading branch information
rummik committed Apr 3, 2014
2 parents 306de78 + e2e3c0f commit c57f864
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
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

0 comments on commit c57f864

Please sign in to comment.