Skip to content

Commit

Permalink
Updated test scripts
Browse files Browse the repository at this point in the history
updated test scripts
  • Loading branch information
ByteMeAsap committed Sep 20, 2024
1 parent 8b52adb commit 7160fea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions delivery_sendcloud_oca/tests/test_delivery_sendcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ def rollback():
force_sendcloud_shipment_code="c9b2058d-2621-4ce5-afb0-f14e8e5565b6"
).action_confirm()
# Set HS code and confirm order
sale_order.mapped("order_line.product_id").write({"hs_code": "123"})
self.env.ref("product.product_delivery_02").write({"hs_code": "123"})
sale_order.mapped("order_line").mapped("product_id").write({"hs_code": "123"})
with rollback():
# Origin Country consistency
with self.assertRaisesRegex(
Expand All @@ -191,7 +192,7 @@ def rollback():
force_sendcloud_shipment_code="c9b2058d-2621-4ce5-afb0-f14e8e5565b6"
).action_confirm()
# Set country_of_origin and confirm order
sale_order.mapped("order_line.product_id").write(
sale_order.mapped("order_line").mapped("product_id").write(
{"country_of_origin": sale_order.warehouse_id.partner_id.country_id}
)
with recorder.use_cassette("shipping_02"):
Expand Down Expand Up @@ -391,7 +392,7 @@ def test_10_auto_create_invoice(self):
# Sale order to outside EU
sale_order = self.env.ref("sale.sale_order_1").copy()
self.assertEqual(sale_order.partner_id.country_id.code, "US")
sale_order.mapped("order_line.product_id").write(
sale_order.mapped("order_line").mapped("product_id").write(
{
"hs_code": "123",
"country_of_origin": sale_order.warehouse_id.partner_id.country_id,
Expand Down

0 comments on commit 7160fea

Please sign in to comment.