tests: Add template test for 9f72052.

This commit is contained in:
Brett Smith 2017-12-30 15:55:25 -05:00
parent 52f2bdcd0e
commit f6599a3deb
2 changed files with 21 additions and 0 deletions

View file

@ -32,3 +32,11 @@ template =
template = {custom_date} {payee} - Custom template = {custom_date} {payee} - Custom
Accrued:Accounts Receivable {amount} Accrued:Accounts Receivable {amount}
Income:Donations -{amount} Income:Donations -{amount}
[Multisplit]
template =
Assets:Cash {amount}
Income:Sales -{amount} + {item_sales}
; :NonItem:
Income:Sales -{item_sales}
; :Item:

View file

@ -126,6 +126,19 @@ def test_zeroed_account_skipped():
" Income:Donations -99.00 USD", " Income:Donations -99.00 USD",
] ]
def test_zeroed_account_last():
render_vars = template_vars('JJ', '90.00', other_vars={
'item_sales': decimal.Decimal(0),
})
lines = render_lines(render_vars, 'Multisplit')
assert lines == [
"",
"2015/03/14 JJ",
" Assets:Cash 90.00 USD",
" Income:Sales -90.00 USD",
" ; :NonItem:",
]
def test_custom_payee_line(): def test_custom_payee_line():
render_vars = template_vars('ZZ', '10.00', other_vars={ render_vars = template_vars('ZZ', '10.00', other_vars={
'custom_date': datetime.date(2014, 2, 13), 'custom_date': datetime.date(2014, 2, 13),