From fc733e793a4778d24ee61439203437059512e955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Mon, 11 Nov 2024 14:17:22 +0100 Subject: [PATCH] [TST] add more tests for branches --- mis_builder/tests/test_aep.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mis_builder/tests/test_aep.py b/mis_builder/tests/test_aep.py index f912898e0..9cb23e53c 100644 --- a/mis_builder/tests/test_aep.py +++ b/mis_builder/tests/test_aep.py @@ -437,9 +437,21 @@ def test_aep_branch(self): branch_move.company_id = self.branch self.aep = AEP(self.company | self.branch) self.aep.parse_expr("balp[]") + self.aep.parse_expr("bale[]") + self.aep.parse_expr("bali[]") self.aep.done_parsing() + # test variation and ending balance self._do_queries( datetime.date(self.curr_year, 3, 1), datetime.date(self.curr_year, 3, 31) ) variation = self._eval_by_account_id("balp[]") self.assertEqual(variation, {self.account_ar.id: 550, self.account_in.id: -550}) + ending = self._eval_by_account_id("bale[]") + self.assertEqual(ending, {self.account_ar.id: 950, self.account_in.id: -850}) + # initial balance at beginning of the next period is the ending balance + # of previous period + self._do_queries( + datetime.date(self.curr_year, 4, 1), datetime.date(self.curr_year, 4, 30) + ) + initial = self._eval_by_account_id("bali[]") + self.assertEqual(initial, {self.account_ar.id: 950, self.account_in.id: -850})