mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_bom_version: Include folder "tests".
[IMP] mrp_bom_component_change: Include folder "tests", and programming improvements.
This commit is contained in:
committed by
Kay K. Cross
parent
68273a5b0d
commit
255d23624b
5
mrp_bom_version/tests/__init__.py
Normal file
5
mrp_bom_version/tests/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
from . import test_mrp_bom_version
|
||||
41
mrp_bom_version/tests/test_mrp_bom_version.py
Normal file
41
mrp_bom_version/tests/test_mrp_bom_version.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
# For copyright and license notices, see __openerp__.py file in root directory
|
||||
##############################################################################
|
||||
import openerp.tests.common as common
|
||||
|
||||
|
||||
class TestMrpBomVersion(common.TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestMrpBomVersion, self).setUp()
|
||||
self.mrp_bom_model = self.env['mrp.bom']
|
||||
vals = {"product_tmpl_id":
|
||||
self.env.ref('product.product_product_11_product_template').id,
|
||||
"active": True,
|
||||
"bom_line_ids":
|
||||
[(0, 0, {'product_id':
|
||||
self.env.ref('product.product_product_5').id}),
|
||||
(0, 0, {'product_id':
|
||||
self.env.ref('product.product_product_6').id})],
|
||||
}
|
||||
self.new_mrp_bom = self.mrp_bom_model.create(vals)
|
||||
|
||||
def test_mrp_bom_version(self):
|
||||
self.assertEqual(self.new_mrp_bom.state, 'draft',
|
||||
"No 'draft' state for MRP new BoM")
|
||||
self.assertEqual(self.new_mrp_bom.version, 1,
|
||||
"Incorrect version for MRP new BoM")
|
||||
self.new_mrp_bom.button_activate()
|
||||
self.assertEqual(self.new_mrp_bom.active, True,
|
||||
"Incorrect active field for MRP new BoM, after"
|
||||
" activation")
|
||||
self.assertEqual(self.new_mrp_bom.state, 'active',
|
||||
"No 'active' state for MRP new BoM, after activation")
|
||||
self.new_mrp_bom.button_historical()
|
||||
self.assertEqual(self.new_mrp_bom.active, False,
|
||||
"Incorrect active field for MRP new BoM, after"
|
||||
" historification")
|
||||
self.assertEqual(self.new_mrp_bom.state, 'historical',
|
||||
"No 'historical' state for MRP new BoM, after"
|
||||
" activation")
|
||||
Reference in New Issue
Block a user