Changeset - cc2b3978011a
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2020-01-10 18:24:58
brettcsmith@brettcsmith.org
tests: Pass amount to Template.render as string.

render is required to convert the string to Decimal for historical design
reasons. Passing the amount as a string verifies this behavior.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
tests/test_hook_ledger_entry.py
Show inline comments
...
 
@@ -20,13 +20,13 @@ with pathlib.Path(DATA_DIR, 'templates.ini').open() as conffile:
 

	
 
def template_from(section_name, *args, **kwargs):
 
    return ledger_entry.Template(config[section_name]['template'], *args, **kwargs)
 

	
 
def template_vars(payee, amount, currency='USD', date=DATE, other_vars=None):
 
    call_vars = {
 
        'amount': decimal.Decimal(amount),
 
        'amount': amount,
 
        'currency': currency,
 
        'date': date,
 
        'payee': payee,
 
        'ledger template': 'template',
 
    }
 
    if other_vars is None:
0 comments (0 inline, 0 general)