Changeset - 0d80c2282ccb
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2020-04-06 14:15:17
brettcsmith@brettcsmith.org
test_meta_invoice: Add explicit "missing invoice" tests.

I wrote this while debugging something else, and I don't want to let
a good test go to waste.
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
tests/test_meta_invoice.py
Show inline comments
...
 
@@ -127,3 +127,15 @@ def test_bad_type_values_on_transaction(hook, acct1, acct2, value):
 
    )
 
    actual = {error.message for error in hook.run(txn)}
 
    assert actual == {expected_msg}
 

	
 
@pytest.mark.parametrize('acct1,acct2', testutil.combine_values(
 
    REQUIRED_ACCOUNTS,
 
    NON_REQUIRED_ACCOUNTS,
 
))
 
def test_missing_invoice(hook, acct1, acct2):
 
    txn = testutil.Transaction(postings=[
 
        (acct2, -25),
 
        (acct1, 25),
 
    ])
 
    actual = {error.message for error in hook.run(txn)}
 
    assert actual == {"{} missing {}".format(acct1, TEST_KEY)}
0 comments (0 inline, 0 general)