mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX] tests
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user