add sorting

This commit is contained in:
Frederik Jaeckel 2023-12-30 11:44:33 +01:00
parent c38737076f
commit 728b2fa6c2
2 changed files with 136 additions and 7 deletions

View file

@ -48,6 +48,25 @@ class CbInvTestCase(object):
self.assertEqual(book.quantity_digits, 4)
self.assertEqual(book.show_performance, True)
# run sorter
books = Book.search(
[],
order=[
('current_value', 'ASC'),
('purchase_amount', 'ASC'),
('diff_amount', 'ASC'),
('yield_balance', 'ASC'),
('diff_percent', 'ASC'),
('quantity', 'ASC'),
('quantity_all', 'ASC'),
('yield_sales', 'ASC'),
('yield_sales_12m', 'ASC'),
('yield_dividend_total', 'ASC'),
('yield_dividend_12m', 'ASC'),
('yield_fee_total', 'ASC'),
('yield_fee_12m', 'ASC'),
])
@with_transaction()
def test_assetbook_aggregated_values(self):
""" create cashbooks with hierarchy, add lines,