예제 #1
0
 def test_two_levels(self):
     ee = ExpressionEvaluator(
         aep=None,
         date_from="2017-01-01",
         date_to="2017-01-16",
     )
     d = self.parent_report._evaluate(ee)
     assert d["pk1"] == 13
예제 #2
0
 def test_basic(self):
     ee = ExpressionEvaluator(
         aep=None,
         date_from="2017-01-01",
         date_to="2017-01-16",
     )
     d = self.report._evaluate(ee)
     assert d["k1"] == 12
예제 #3
0
 def test_one_item_and_prorata_second(self):
     aep = self.report._prepare_aep(self.env.ref("base.main_company"))
     ee = ExpressionEvaluator(
         aep=aep,
         date_from="2017-01-01",
         date_to="2017-01-12",
         aml_model="mis.budget.by.account.item",
     )
     d = self.report._evaluate(ee)
     assert d["k1"] == 11.0 + 13.0 / 2
예제 #4
0
 def test_basic(self):
     """ Sum all budget items in period """
     aep = self.report._prepare_aep(self.env.ref("base.main_company"))
     ee = ExpressionEvaluator(
         aep=aep,
         date_from="2017-01-01",
         date_to="2017-01-16",
         aml_model="mis.budget.by.account.item",
     )
     d = self.report._evaluate(ee)
     assert d["k1"] == 24.0