@@ -209,26 +209,12 @@ def test_accrual_postings_consistent_account(acct_name):
(acct_name, 25, meta),
])
related = accrual.AccrualPostings(data.Posting.from_txn(txn))
assert related.account == acct_name
assert related.accounts == {acct_name}
@pytest.mark.parametrize('cost', [
testutil.Cost('1.2', 'USD'),
None,
def test_accrual_postings_consistent_cost(cost):
meta = {'invoice': 'FXinvoice.pdf'}
txn = testutil.Transaction(postings=[
(ACCOUNTS[0], 60, 'EUR', cost, meta),
(ACCOUNTS[0], 30, 'EUR', cost, meta),
assert related.cost == cost
assert related.costs == {cost}
@pytest.mark.parametrize('meta_key,acct_name', testutil.combine_values(
CONSISTENT_METADATA,
ACCOUNTS,
))
def test_accrual_postings_consistent_metadata(meta_key, acct_name):
meta_value = f'{meta_key}.pdf'
@@ -252,26 +238,12 @@ def test_accrual_postings_inconsistent_account():
for index, acct_name in enumerate(ACCOUNTS)
assert related.account is related.INCONSISTENT
assert related.accounts == set(ACCOUNTS)
def test_accrual_postings_inconsistent_cost():
costs = {
testutil.Cost('1.1', 'USD'),
}
(ACCOUNTS[0], 10, 'EUR', cost, meta)
for cost in costs
assert related.cost is related.INCONSISTENT
assert related.costs == costs
def test_accrual_postings_inconsistent_metadata(meta_key, acct_name):
invoice = 'invoice with {meta_key}.pdf'