summaryrefslogtreecommitdiff
path: root/addons/product_matrix
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-11-21 14:30:02 +0000
committerVictor Feyens <vfe@odoo.com>2019-11-27 15:49:57 +0000
commitc32e9a47886a4d9b008c8c2b18172aa98907d353 (patch)
treebcef7e51df60568bbc1de401c506a772843a87bb /addons/product_matrix
parent6c800032088128d818fc970afee7cc7f1c365a6e (diff)
[ADD] (*_)_product_matrix: test tours
closes odoo/odoo#40971 X-original-commit: d729460f5fc72aa70e0a024e1dff281299eed0e3 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Diffstat (limited to 'addons/product_matrix')
-rw-r--r--addons/product_matrix/tests/__init__.py4
-rw-r--r--addons/product_matrix/tests/common.py46
2 files changed, 50 insertions, 0 deletions
diff --git a/addons/product_matrix/tests/__init__.py b/addons/product_matrix/tests/__init__.py
new file mode 100644
index 00000000000..511e649c9e2
--- /dev/null
+++ b/addons/product_matrix/tests/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import common
diff --git a/addons/product_matrix/tests/common.py b/addons/product_matrix/tests/common.py
new file mode 100644
index 00000000000..51e0a366588
--- /dev/null
+++ b/addons/product_matrix/tests/common.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from odoo.tests import tagged, common
+
+
+@tagged('post_install', '-at_install')
+class TestMatrixCommon(common.HttpCase):
+
+ def setUp(self):
+ super(TestMatrixCommon, self).setUp()
+
+ # Prepare relevant test data
+ # This is not included in demo data to avoid useless noise
+ product_attributes = self.env['product.attribute'].create([{
+ 'name': 'PA1',
+ 'create_variant': 'always',
+ 'sequence': 1
+ }, {
+ 'name': 'PA2',
+ 'create_variant': 'always',
+ 'sequence': 2
+ }, {
+ 'name': 'PA3',
+ 'create_variant': 'dynamic',
+ 'sequence': 3
+ }, {
+ 'name': 'PA4',
+ 'create_variant': 'no_variant',
+ 'sequence': 4
+ }])
+
+ self.env['product.attribute.value'].create([{
+ 'name': 'PAV' + str(product_attribute.sequence) + str(i),
+ 'attribute_id': product_attribute.id
+ } for i in range(1, 3) for product_attribute in product_attributes])
+
+ self.matrix_template = self.env['product.template'].create({
+ 'name': "Matrix",
+ 'type': "consu",
+ 'uom_id': self.ref("uom.product_uom_unit"),
+ 'uom_po_id': self.ref("uom.product_uom_unit"),
+ 'attribute_line_ids': [(0, 0, {
+ 'attribute_id': attribute.id,
+ 'value_ids': [(6, 0, attribute.value_ids.ids)]
+ }) for attribute in product_attributes],
+ })