From 1cc2e7c9dfc5950eaa841a61723f6871545e65dc Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 1 Jun 2018 10:59:51 +0200 Subject: [PATCH] [FIX] tests --- rma_analytic/tests/test_rma_analytic.py | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/rma_analytic/tests/test_rma_analytic.py b/rma_analytic/tests/test_rma_analytic.py index fdff1c61..77fea3d4 100644 --- a/rma_analytic/tests/test_rma_analytic.py +++ b/rma_analytic/tests/test_rma_analytic.py @@ -7,26 +7,28 @@ from odoo.addons.rma.tests import test_rma class TestRmaAnalytic(test_rma.TestRma): - def setUp(self): - super(TestRmaAnalytic, self).setUp() - products2move = [(self.product_1, 3), (self.product_2, 5), - (self.product_3, 2)] - self.rma_ana_id = self._create_rma_from_move( - products2move, 'supplier', self.env.ref('base.res_partner_1'), + @classmethod + def setUp(cls): + super(TestRmaAnalytic, cls).setUp() + products2move = [(cls.product_1, 3), (cls.product_2, 5), + (cls.product_3, 2)] + cls.rma_ana_id = cls._create_rma_from_move( + products2move, 'supplier', cls.env.ref('base.res_partner_1'), dropship=False) - def _prepare_move(self, product, qty, src, dest, picking_in): - res = super(TestRmaAnalytic, self)._prepare_move( + @classmethod + def _prepare_move(cls, product, qty, src, dest, picking_in): + res = super(TestRmaAnalytic, cls)._prepare_move( product, qty, src, dest, picking_in) - analytic_1 = self.env['account.analytic.account'].create({ + analytic_1 = cls.env['account.analytic.account'].create({ 'name': 'Test account #1', }) res.update({'analytic_account_id': analytic_1.id}) return res - def test_analytic(self): - for line in self.rma_ana_id.rma_line_ids: + def test_analytic(cls): + for line in cls.rma_ana_id.rma_line_ids: for move in line.move_ids: - self.assertEqual( + cls.assertEqual( line.analytic_account_id, move.analytic_account_id, "the analytic account is not propagated")