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

Commit

Permalink
Failing tests for grprbn edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Sep 1, 2016
1 parent 5e22e91 commit 51663f5
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tests/py/test_billing_exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,31 @@ def test_grprbn_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_grprbn_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_grprbn_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_grprbn_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_grprbn_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_grprbn_includes_1_0_payouts(self):
alice = self.make_participant('alice', balance=24, status_of_1_0_payout='pending-payout')
Expand Down

0 comments on commit 51663f5

Please sign in to comment.