File diff 3d704e2865fe → c88c5ef3b05d
tests/test_reports_accrual.py
Show inline comments
...
 
@@ -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),
 
    ])
 
    related = accrual.AccrualPostings(data.Posting.from_txn(txn))
 
    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)
 
    ])
 
    related = accrual.AccrualPostings(data.Posting.from_txn(txn))
 
    assert related.account is related.INCONSISTENT
 
    assert related.accounts == set(ACCOUNTS)
 

	
 
def test_accrual_postings_inconsistent_cost():
 
    meta = {'invoice': 'FXinvoice.pdf'}
 
    costs = {
 
        testutil.Cost('1.1', 'USD'),
 
        testutil.Cost('1.2', 'USD'),
 
    }
 
    txn = testutil.Transaction(postings=[
 
        (ACCOUNTS[0], 10, 'EUR', cost, meta)
 
        for cost in costs
 
    ])
 
    related = accrual.AccrualPostings(data.Posting.from_txn(txn))
 
    assert related.cost is related.INCONSISTENT
 
    assert related.costs == costs
 

	
 
@pytest.mark.parametrize('meta_key,acct_name', testutil.combine_values(
 
    CONSISTENT_METADATA,
 
    ACCOUNTS,
 
))
 
def test_accrual_postings_inconsistent_metadata(meta_key, acct_name):
 
    invoice = 'invoice with {meta_key}.pdf'