def test_next_with_transactions(self):
b = Mock(spec_set=_BillingPeriod)
b_next = Mock(spec_set=_BillingPeriod)
type(b).next_period = PropertyMock(return_value=b_next)
i = Mock(spec_set=_InterestCalculation)
p = Mock(spec_set=_MinPaymentFormula)
cls = CCStatement(
i, Decimal('1.23'), p, b,
end_balance=Decimal('1.50'), interest_amt=Decimal('0.27')
)
mock_stmt = Mock(spec_set=CCStatement)
with patch('biweeklybudget.interest.CCStatement', autospec=True) as m:
m.return_value = mock_stmt
res = cls.next_with_transactions({'foo': 'bar'})
assert res == mock_stmt
assert m.mock_calls == [
call(
i, Decimal('1.50'), p, b_next, transactions={'foo': 'bar'}
)
]
评论列表
文章目录