Changeset - 13c316acf6e1
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2019-11-11 15:40:19
brettcsmith@brettcsmith.org
tests: More tests for positive results for last commit.
1 file changed with 25 insertions and 0 deletions:
0 comments (0 inline, 0 general)
tests/test_hook_ledger_entry.py
Show inline comments
...
 
@@ -182,6 +182,31 @@ def test_line1_not_custom_payee():
 
        "  Income:Donations  -15.00 USD",
 
    ]
 

	
 
def test_only_payee_line_date_is_required():
 
    render_vars = template_vars('VY', '17.50', other_vars={
 
        'custom_date': datetime.date(2014, 2, 11),
 
    })
 
    del render_vars['date']
 
    lines = render_lines(render_vars, 'Custom Payee')
 
    assert lines == [
 
        "",
 
        "2014/02/11  VY - Custom",
 
        "  Accrued:Accounts Receivable  17.50 USD",
 
        "  Income:Donations  -17.50 USD",
 
    ]
 

	
 
def test_dates_can_be_none_except_payee_line_date():
 
    render_vars = template_vars('VZ', '18.00', date=None, other_vars={
 
        'custom_date': datetime.date(2014, 2, 10),
 
    })
 
    lines = render_lines(render_vars, 'Custom Payee')
 
    assert lines == [
 
        "",
 
        "2014/02/10  VZ - Custom",
 
        "  Accrued:Accounts Receivable  18.00 USD",
 
        "  Income:Donations  -18.00 USD",
 
    ]
 

	
 
def test_custom_date_missing():
 
    render_vars = template_vars('YY', '20.00')
 
    with pytest.raises(errors.UserInputConfigurationError):
0 comments (0 inline, 0 general)