fava.ext.fava_ext_test

Fava extension to test extension functionality.

# This can be used mainly for testing of the extension functionality and usage of e.g. extension Javascript code or custom elements.

class fava.ext.fava_ext_test.FavaExtTest(ledger, config=None)

Fava extension to test extension functionality.

chart_data()

Return some chart data.

Return type:

list[BalancesChart]

example_data()

Return some data with a GET endpoint.

Return type:

Response

has_js_module: bool = True

Whether this extension includes a Javascript module.

portfolio_accounts(filter_str=None)

Get an account tree based on matching regex patterns.

Return type:

list[Portfolio]

report_title: str | None = 'Fava extension test'

Name for a HTML report for this extension.

class fava.ext.fava_ext_test.Portfolio(title, rows, types=(('account', <class 'str'>), ('balance', <class 'decimal.Decimal'>), ('allocation', <class 'decimal.Decimal'>)))

A portfolio.

rows: list[Row]
title: str
types: tuple[tuple[str, type[Any]], ...] = (('account', <class 'str'>), ('balance', <class 'decimal.Decimal'>), ('allocation', <class 'decimal.Decimal'>))
class fava.ext.fava_ext_test.Row(account: str, balance: Decimal | None, allocation: Decimal | None)

A row in the portfolio tables.