File diff fff211386f0a → 6703d1af87ad
tests/test_reports_fund.py
Show inline comments
...
 
@@ -184,25 +184,27 @@ def check_ods_sheet(sheet, account_balances, *, full):
 
        }
 
    totals = {key: Decimal() for key in total_keys}
 
    for fund, balances in account_bals.items():
 
        for key in totals:
 
            totals[key] += balances[key]
 
    account_bals[''] = totals
 
    if full:
 
        account_bals['Unrestricted'] = unrestricted
 
    for row in itertools.islice(sheet.getElementsByType(odf.table.TableRow), 4, None):
 
        cells = iter(testutil.ODSCell.from_row(row))
 
        try:
 
            fund = next(cells).firstChild.text
 
        except (AttributeError, StopIteration):
 
        except AttributeError:
 
            fund = ''
 
        except StopIteration:
 
            continue
 
        try:
 
            balances = account_bals.pop(fund)
 
        except KeyError:
 
            pytest.fail(f"report included unexpected fund {fund}")
 
        check_cell_balance(next(cells), balances['opening'])
 
        check_cell_balance(next(cells), balances['Income'])
 
        if full:
 
            check_cell_balance(next(cells), -balances['Expenses'])
 
            check_cell_balance(next(cells), balances['Equity'])
 
        else:
 
            check_cell_balance(