This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,10 @@ | |
capture_card_hold, | ||
create_card_hold, | ||
record_exchange, | ||
record_exchange_result | ||
record_exchange_result, | ||
get_ready_payout_routes_by_network | ||
) | ||
from gratipay.billing.payday import Payday | ||
from gratipay.exceptions import NegativeBalance, NotWhitelisted | ||
from gratipay.models.exchange_route import ExchangeRoute | ||
from gratipay.testing import Foobar, Harness, D,P | ||
|
@@ -145,6 +147,30 @@ def test_capch_amount_under_minimum(self): | |
assert self.obama.get_credit_card_error() == '' | ||
|
||
|
||
# grprbn - get_ready_payout_routes_by_network | ||
|
||
@mock.patch.object(Payday, 'fetch_card_holds') | ||
def run_payday(self, fch): | ||
fch.return_value = {} | ||
Payday.start().run() | ||
|
||
def test_grprbn_that_its_empty_to_start_with(self): | ||
assert get_ready_payout_routes_by_network(self.db, 'paypal') == [] | ||
|
||
def test_grprbn_includes_team_owners(self): | ||
enterprise = self.make_team(is_approved=True) | ||
self.obama.set_payment_instruction(enterprise, 100) | ||
self.run_payday() | ||
routes = get_ready_payout_routes_by_network(self.db, 'paypal') | ||
assert [r.participant.username for r in routes] == ['picard'] | ||
|
||
def test_grprbn_includes_1_0_payouts(self): | ||
alice = self.make_participant('alice', balance=24, status_of_1_0_payout='pending-payout') | ||
ExchangeRoute.insert(alice, 'paypal', '[email protected]') | ||
routes = get_ready_payout_routes_by_network(self.db, 'paypal') | ||
assert [r.participant.username for r in routes] == ['alice'] | ||
|
||
|
||
class TestsWithoutBillingHarness(Harness): | ||
|
||
def prep(self, amount): | ||
|