diff --git a/tests/py/test_billing_payday.py b/tests/py/test_billing_payday.py index 997bb7bb26..fa56674cfc 100644 --- a/tests/py/test_billing_payday.py +++ b/tests/py/test_billing_payday.py @@ -439,7 +439,7 @@ def test_process_remainder(self): assert cursor.one("select balance from payday_teams where slug='TheEnterprise'") == 0 payday.update_balances(cursor) - assert P('alice').balance == D('0.49') + assert P('alice').balance == D('0.49') # Alice had $1 and gave away $0.51 assert P('picard').balance == D('0.51') payment = self.db.one("SELECT * FROM payments WHERE direction='to-participant'") @@ -531,7 +531,6 @@ def run_through_takes(self): self.payday.process_takes(cursor, self.payday.ts_start) self.payday.update_balances(cursor) - # pt - process_takes def test_pt_processes_takes(self): @@ -610,6 +609,19 @@ def test_pt_is_NOT_happy_to_deal_the_owner_in(self): assert P('bruiser').balance == D('250.00') assert P('picard').balance == D(' 50.00') + def test_process_remainder_only_processes_pt_leftovers(self): + self.make_member('alice', 100) + self.start_payday() + with self.db.get_cursor() as cursor: + self.payday.prepare(cursor) + cursor.run("UPDATE payday_teams SET balance=500") + self.payday.process_takes(cursor, self.payday.ts_start) + self.payday.process_remainder(cursor) + self.payday.update_balances(cursor) + + assert P('alice').balance == D('100') + assert P('picard').balance == D('400') # Owner receives whatever is left + class TestNotifyParticipants(EmailHarness):