diff --git a/tests/py/test_billing_payday.py b/tests/py/test_billing_payday.py index cdf4d0d584..7222d467cc 100644 --- a/tests/py/test_billing_payday.py +++ b/tests/py/test_billing_payday.py @@ -513,16 +513,18 @@ def test_payout_no_balanced_href_does_________what_question_mark(self): balance=20) Payday.start().payout() - @mock.patch('gratipay.billing.payday.log') - @mock.patch('gratipay.billing.exchanges.thing_from_href') - def test_payout_can_pay_out(self, tfh, log): - self.make_participant('alice', claimed_time='now', is_suspicious=False, - balance=20, balanced_customer_href='foo', + @mock.patch('gratipay.billing.payday.ach_credit') + def test_payout_can_pay_out(self, ach): + alice = self.make_participant('alice', claimed_time='now', is_suspicious=False, + balanced_customer_href='foo', last_ach_result='') + self.make_exchange('balanced-cc', 20, 0, alice) self.make_team(owner='alice', is_approved=True) Payday.start().payout() - log.assert_any_call('Crediting alice 2000 cents ($20.00 - $0.00 fee = $20.00) on Balanced ' - '... succeeded.') + + assert ach.call_count == 1 + assert ach.call_args_list[0][1].id == alice.id + assert ach.call_args_list[0][2] == 0 @mock.patch('gratipay.billing.payday.log') def test_payout_skips_unreviewed(self, log):