Changeset - 3f9e67de3ac5
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-03-18 13:00:47
brettcsmith@brettcsmith.org
meta_tax_implication: Don't enforce on Assets:PrepaidExpenses.
2 files changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/plugin/meta_tax_implication.py
Show inline comments
...
 
@@ -47,7 +47,7 @@ class MetaTaxImplication(core._NormalizePostingMetadataHook):
 

	
 
    def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool:
 
        return bool(
 
            post.account.startswith('Assets:')
 
            post.account.is_real_asset()
 
            and post.units.number
 
            and post.units.number < DEFAULT_STOP_AMOUNT
 
        )
tests/test_meta_tax_implication.py
Show inline comments
...
 
@@ -109,6 +109,16 @@ def test_non_asset_accounts_skipped(account):
 
    assert not errors
 
    testutil.check_post_meta(txn, None, meta)
 

	
 
def test_prepaid_expenses_skipped():
 
    txn = testutil.Transaction(postings=[
 
        ('Expenses:General', 25),
 
        ('Assets:PrepaidExpenses', -25),
 
    ])
 
    checker = meta_tax_implication.MetaTaxImplication()
 
    errors = list(checker.run(txn))
 
    assert not errors
 
    testutil.check_post_meta(txn, None, None)
 

	
 
def test_asset_credits_skipped():
 
    txn = testutil.Transaction(postings=[
 
        ('Income:Donations', -25),
0 comments (0 inline, 0 general)