@@ -75,12 +75,19 @@ def test_balance_credit_card(credit_card_cycle):
post = txn.postings[0]
expected += post.units.number
related.add(post)
assert related.balance() == testutil.balance_map(USD=expected)
assert expected == 0
def test_clear():
related = core.RelatedPostings()
related.add(testutil.Posting('Income:Donations', -10))
assert related.balance()
related.clear()
assert not related.balance()
def check_iter_with_balance(entries):
expect_posts = [txn.postings[0] for txn in entries]
expect_balances = []
balance_tally = collections.defaultdict(Decimal)
for post in expect_posts: