Skip to content

Commit

Permalink
[IMP] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhao committed Feb 19, 2021
1 parent c0bb086 commit 282e1ab
Showing 1 changed file with 38 additions and 42 deletions.
80 changes: 38 additions & 42 deletions sale_configurator_option/tests/test_sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,29 @@ def test_create_sale_with_option_ids(self):
{
"product_id": self.product_with_option.id,
"product_uom_qty": 2,
"option_ids": [
(
0,
0,
{
"option_unit_qty": 5,
"product_id": self.product_option_1.id,
"option_qty_type": "proportional_qty",
},
),
(
0,
0,
{
"option_unit_qty": 2,
"product_id": self.product_option_2.id,
"option_qty_type": "proportional_qty",
},
),
],
},
)
],
}
)
self.env["sale.order.line"].create(
[
{
"option_unit_qty": 5,
"product_id": self.product_option_1.id,
"option_qty_type": "proportional_qty",
"parent_id": sale.order_line.id,
"order_id": sale.id,
},
{
"option_unit_qty": 2,
"product_id": self.product_option_2.id,
"option_qty_type": "proportional_qty",
"parent_id": sale.order_line.id,
"order_id": sale.id,
},
],
)
lines = sale.order_line
self.assertEqual(len(lines), 3)
self.assertEqual(lines[0].product_uom_qty, 2)
Expand All @@ -136,33 +134,31 @@ def test_order_line_order_create(self):
"sequence": 10,
"product_id": self.product_with_option.id,
"product_uom_qty": 2,
"option_ids": [
(
0,
0,
{
"sequence": 30,
"option_unit_qty": 5,
"product_id": self.product_option_1.id,
"option_qty_type": "proportional_qty",
},
),
(
0,
0,
{
"sequence": 20,
"option_unit_qty": 2,
"product_id": self.product_option_2.id,
"option_qty_type": "proportional_qty",
},
),
],
},
)
],
}
)
self.env["sale.order.line"].create(
[
{
"sequence": 30,
"option_unit_qty": 5,
"product_id": self.product_option_1.id,
"option_qty_type": "proportional_qty",
"parent_id": sale.order_line.id,
"order_id": sale.id,
},
{
"sequence": 20,
"option_unit_qty": 2,
"product_id": self.product_option_2.id,
"option_qty_type": "proportional_qty",
"parent_id": sale.order_line.id,
"order_id": sale.id,
},
]
)
sale.refresh()
lines = sale.order_line
self.assertEqual(lines[0].sequence, 0)
Expand Down

0 comments on commit 282e1ab

Please sign in to comment.