diff --git a/tests/test_hook_ledger_entry.py b/tests/test_hook_ledger_entry.py index ffa723500d8da62fa56b18f09fd33cc08f527a40..d1c5213a30f36e4b064a0a328a521848f0e627f7 100644 --- a/tests/test_hook_ledger_entry.py +++ b/tests/test_hook_ledger_entry.py @@ -199,6 +199,21 @@ def test_conditional(amount, expect_fee): " Income:Sales -{} USD".format(amount_s), ] +def test_string_conditionals(): + render_vars = template_vars('MM', '6', other_vars={ + 'false': '', + 'true': 'true', + }) + lines = render_lines(render_vars, 'StringConditional') + assert lines == [ + "", + "2015/03/14 MM", + " Income:Sales -1.00 USD", + " Income:Sales -2.00 USD", + " Income:Sales -3.00 USD", + " Assets:Cash 6.00 USD", + ] + @pytest.mark.parametrize('amount_expr', [ '', 'name',