From 82a34204b852af589b17805f99e8110bb4d90fab Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 1 Sep 2016 10:01:11 -0400 Subject: [PATCH] Failing tests for grprbn edge cases --- tests/py/test_billing_exchanges.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/py/test_billing_exchanges.py b/tests/py/test_billing_exchanges.py index 971713fbcc..2f6a812636 100644 --- a/tests/py/test_billing_exchanges.py +++ b/tests/py/test_billing_exchanges.py @@ -153,13 +153,31 @@ def test_includes_team_owners(self): routes = get_ready_payout_routes_by_network(self.db, 'paypal') assert [r.participant.username for r in routes] == ['picard'] - def test_includes_team_members(self): + + def run_payday_with_member(self): enterprise = self.make_team(is_approved=True, available=50) - enterprise.add_member(self.homer, P('picard')) # add a member + enterprise.add_member(self.homer, P('picard')) self.obama.set_payment_instruction(enterprise, 100) self.run_payday() + return enterprise + + def test_includes_team_members(self): + self.run_payday_with_member() + routes = get_ready_payout_routes_by_network(self.db, 'paypal') + assert list(sorted([r.participant.username for r in routes])) == ['homer', 'picard'] + + def test_includes_former_team_members(self): + enterprise = self.run_payday_with_member() + enterprise.remove_member(self.homer, P('picard')) + routes = get_ready_payout_routes_by_network(self.db, 'paypal') + assert list(sorted([r.participant.username for r in routes])) == ['homer', 'picard'] + + def test_excludes_member_with_no_verified_identity(self): + self.run_payday_with_member() + self.homer.clear_identity(self.homer.list_identity_metadata()[0].country.id) routes = get_ready_payout_routes_by_network(self.db, 'paypal') - assert [r.participant.username for r in routes] == ['homer', 'picard'] + assert [r.participant.username for r in routes] == ['picard'] + def test_includes_1_0_payouts(self): alice = self.make_participant('alice', balance=24, status_of_1_0_payout='pending-payout')