diff --git a/tests/test_reports_related_postings.py b/tests/test_reports_related_postings.py index 6707a2414ed8626cfc0375695511341368750b31..d014a941a10e6cc0f3773582ed4d18bea299ca7c 100644 --- a/tests/test_reports_related_postings.py +++ b/tests/test_reports_related_postings.py @@ -90,7 +90,7 @@ def test_balance_credit_card(credit_card_cycle, index, expected): related = core.RelatedPostings( txn.postings[0] for txn in credit_card_cycle[:index + 1] ) - assert related.balance() == testutil.balance_map(USD=expected) + assert related.balance() == {'USD': testutil.Amount(expected, 'USD')} def check_iter_with_balance(entries): expect_posts = [txn.postings[0] for txn in entries] @@ -99,7 +99,8 @@ def check_iter_with_balance(entries): for post in expect_posts: number, currency = post.units balance_tally[currency] += number - expect_balances.append(testutil.balance_map(balance_tally.items())) + expect_balances.append({code: testutil.Amount(number, code) + for code, number in balance_tally.items()}) related = core.RelatedPostings(expect_posts) for (post, balance), exp_post, exp_balance in zip( related.iter_with_balance(),