summaryrefslogtreecommitdiff
path: root/addons/product/tests
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-01 16:01:54 +0200
committerChristophe Simonis <chs@odoo.com>2018-10-01 16:01:54 +0200
commit43b63a04656276926dfecd65d3058d6464ee8ac5 (patch)
treed0f7c5b4a66540fa8422de2be928a30167e45eed /addons/product/tests
parentb2870ae1ebc4d198c69142a2399827848d7d30b4 (diff)
parent57e387b645200756c29423af463afe001707f2ac (diff)
[MERGE] forward port branch saas-11.4 up to 57e387b6452
Diffstat (limited to 'addons/product/tests')
-rw-r--r--addons/product/tests/common.py1
-rw-r--r--addons/product/tests/test_variants.py8
2 files changed, 9 insertions, 0 deletions
diff --git a/addons/product/tests/common.py b/addons/product/tests/common.py
index cc812db81a2..559b8b9dcfa 100644
--- a/addons/product/tests/common.py
+++ b/addons/product/tests/common.py
@@ -36,6 +36,7 @@ class TestProductCommon(common.SavepointCase):
cls.product_1 = Product.create({
'name': 'Courage',
'type': 'consu',
+ 'default_code': 'PROD-1',
'uom_id': cls.uom_dunit.id,
'uom_po_id': cls.uom_dunit.id})
diff --git a/addons/product/tests/test_variants.py b/addons/product/tests/test_variants.py
index 0819c7dfdf3..8fc890c31f1 100644
--- a/addons/product/tests/test_variants.py
+++ b/addons/product/tests/test_variants.py
@@ -60,6 +60,14 @@ class TestVariants(common.TestProductCommon):
self.size_attr_value_l = self.env['product.attribute.value'].create({'name': 'L', 'attribute_id': self.size_attr.id})
return res
+ def test_variants_is_product_variant(self):
+ template = self.product_7_template
+ variants = template.product_variant_ids
+ self.assertFalse(template.is_product_variant,
+ 'Product template is not a variant')
+ self.assertEqual({True}, set(v.is_product_variant for v in variants),
+ 'Product variants are variants')
+
def test_variants_creation_mono(self):
test_template = self.env['product.template'].create({
'name': 'Sofa',