@@ -8,35 +8,28 @@ class ConfigurationCreate(TransactionCase):
88 def test_create (self ):
99 """Test configuration item does not make variations"""
1010
11- attr_test = self .env ['product.attribute' ].create (
12- {'name' : 'Test' ,
13- 'value_ids' : [
14- (0 , 0 , {'name' : '1' }),
15- (0 , 0 , {'name' : '2' }),
16- ],
17- }
18- )
19- test_template = self .env ['product.template' ].create (
20- {'name' : 'Test Configuration' ,
21- 'config_ok' : True ,
22- 'type' : 'product' ,
23- 'categ_id' : self .env ['ir.model.data' ].xmlid_to_res_id (
24- 'product.product_category_5'
25- ),
26- 'attribute_line_ids' : [
27- (0 , 0 , {'attribute_id' : attr_test .id ,
28- 'value_ids' : [
29- (6 , 0 , attr_test .value_ids .ids ),
30- ],
31- 'required' : True ,
32- }),
33- ]
34- }
35- )
11+ attr_test = self .env ['product.attribute' ].create ({
12+ 'name' : 'Test' ,
13+ 'value_ids' : [
14+ (0 , 0 , {'name' : '1' }),
15+ (0 , 0 , {'name' : '2' }),
16+ ],
17+ })
3618
37- self .assertEqual (
38- test_template .product_variant_count ,
39- 0 ,
40- "Create should not have any variants"
41- )
19+ test_template = self .env ['product.template' ].create ({
20+ 'name' : 'Test Configuration' ,
21+ 'config_ok' : True ,
22+ 'type' : 'product' ,
23+ 'categ_id' : self .env .ref ('product.product_category_5' ).id ,
24+ 'attribute_line_ids' : [(0 , 0 , {
25+ 'attribute_id' : attr_test .id ,
26+ 'value_ids' : [
27+ (6 , 0 , attr_test .value_ids .ids ),
28+ ],
29+ 'required' : True ,
30+ }),
31+ ]
32+ })
4233
34+ self .assertEqual (test_template .product_variant_count , 0 ,
35+ "Create should not have any variants" )
0 commit comments