Begin implementing better payment simulation

This commit is contained in:
2023-05-05 13:41:00 +01:00
parent 64fd072f2f
commit 35607898f0
6 changed files with 200 additions and 52 deletions

View File

@@ -237,3 +237,20 @@ class TestMoney(AggregatorPlatformMixin, TransactionTestCase):
amount, expected_requisition[wallets_requisition.index(wallet)]
)
self.assertIn("Requisition", detail)
def test_collapse_pay_list(self):
self.create_wallets()
test_data = {
"WALLET1": [
(500.0, "Operator cut for 2 of 1 operators, total 1000.0"),
(500.0, "Operator cut for 1 of 2 operators, total 1000.0"),
],
"WALLET2": [(0.0, "Platform Live cut for 1 of 1 payees, total 500.0")],
}
expected = {
"WALLET1": 1000.0,
"WALLET2": 0.0,
}
collapsed = money.collapse_pay_list(test_data)
self.assertDictEqual(collapsed, expected)