Skip to content

Commit

Permalink
[IMP] mis_builder: add test for actuals_alt data source
Browse files Browse the repository at this point in the history
fixes OCA#285
  • Loading branch information
sbidoul committed Sep 24, 2017
1 parent cc37675 commit 316b59e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mis_builder/tests/__init__.py
Expand Up @@ -5,11 +5,11 @@
from . import test_accounting_none
from . import test_aep
from . import test_aggregate
from . import test_data_sources
from . import test_kpi_data
from . import test_mis_report_instance
from . import test_mis_safe_eval
from . import test_period_dates
from . import test_render
from . import test_simple_array
from . import test_sum_cmp
from . import test_utc_midnight
Expand Up @@ -9,13 +9,13 @@
CMP_DIFF,
)
from ..models.mis_report_instance import (
MODE_NONE, SRC_CMPCOL, SRC_SUMCOL,
MODE_NONE, SRC_CMPCOL, SRC_SUMCOL, SRC_ACTUALS_ALT,
)

from .common import assert_matrix


class TestMisReportInstanceSumCmp(common.TransactionCase):
class TestMisReportInstanceDataSources(common.TransactionCase):
""" Test sum and comparison data source.
"""

Expand All @@ -36,7 +36,7 @@ def _create_move(self, date, amount, debit_acc, credit_acc):
return move

def setUp(self):
super(TestMisReportInstanceSumCmp, self).setUp()
super(TestMisReportInstanceDataSources, self).setUp()
self.account_model = self.env['account.account']
self.move_model = self.env['account.move']
self.journal_model = self.env['account.journal']
Expand Down Expand Up @@ -189,3 +189,13 @@ def test_cmp(self):
[11, 13, 2],
[AccountingNone, 17, 17],
])

def test_actuals_alt(self):
self.kpi2.auto_expand_accounts = False
self.p1.source = SRC_ACTUALS_ALT
self.p2.source = SRC_ACTUALS_ALT
matrix = self.instance._compute_matrix()
assert_matrix(matrix, [
[11, 13],
[11, 30],
])

0 comments on commit 316b59e

Please sign in to comment.