From 9fb57975a00d35861d30bb7299b67114a2857f3d Mon Sep 17 00:00:00 2001 From: Changaco Date: Wed, 16 Jul 2014 23:36:43 +0200 Subject: [PATCH] failing test for #916 --- tests/py/test_billing_payday.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/py/test_billing_payday.py b/tests/py/test_billing_payday.py index b14a8e9cf1..2cd2fa2736 100644 --- a/tests/py/test_billing_payday.py +++ b/tests/py/test_billing_payday.py @@ -291,6 +291,19 @@ def test_card_hold_error(self, Customer, fch): payday = self.fetch_payday() assert payday['ncc_failing'] == 1 + def test_payin_doesnt_process_tips_when_goal_is_negative(self): + alice = self.make_participant('alice', claimed_time='now', balance=20) + bob = self.make_participant('bob', claimed_time='now') + alice.set_tip_to(bob, 13) + self.db.run("UPDATE participants SET goal = -1 WHERE username='bob'") + payday = Payday.start() + with self.db.get_cursor() as cursor: + payday.prepare(cursor, payday.ts_start) + payday.transfer_tips(cursor) + payday.update_balances(cursor) + assert Participant.from_id(alice.id).balance == 20 + assert Participant.from_id(bob.id).balance == 0 + def test_transfer_takes(self): a_team = self.make_participant('a_team', claimed_time='now', number='plural', balance=20) alice = self.make_participant('alice', claimed_time='now')