diff --git a/tests/test_meta_expenseAllocation.py b/tests/test_meta_expenseAllocation.py index 9592ba151e8ea24397a0b84041047cf0a092a9a2..34d9dd86675cf2b56475af1d2c23a38ef5ea4c10 100644 --- a/tests/test_meta_expenseAllocation.py +++ b/tests/test_meta_expenseAllocation.py @@ -92,3 +92,20 @@ def test_non_expense_accounts_skipped(account): checker = meta_expense_allocation.MetaExpenseAllocation() errors = checker.check(txn, txn.postings[0]) assert not errors + +@pytest.mark.parametrize('account,set_value', [ + ('Expenses:Services:Accounting', 'administration'), + ('Expenses:Services:Administration', 'administration'), + ('Expenses:Services:Advocacy', 'program'), + ('Expenses:Services:Development', 'program'), + ('Expenses:Services:Fundraising', 'fundraising'), +]) +def test_default_values(account, set_value): + txn = testutil.Transaction(postings=[ + ('Liabilites:CreditCard', -25), + (account, 25), + ]) + checker = meta_expense_allocation.MetaExpenseAllocation() + errors = checker.check(txn, txn.postings[-1]) + assert not errors + assert txn.postings[-1].meta['expenseAllocation'] == set_value