File diff 8516134687e8 → 13c316acf6e1
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):