Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit 3e29ee6

Browse files
committed
Flake8 fixes
1 parent 28b6cf4 commit 3e29ee6

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# -*- coding: utf-8 -*-
22

3-
from . import test_configuration_rules, test_create
3+
from . import test_create
4+
from . import test_configuration_rules

product_configurator/tests/test_create.py

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)