Skip to content

Commit

Permalink
Updated test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteMeAsap committed Sep 20, 2024
1 parent c59f965 commit a2f72f3
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions delivery_sendcloud_oca/tests/test_delivery_sendcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,6 @@ def rollback():
with recorder.use_cassette("shipping_methods"):
delivery_carrier_obj.sendcloud_sync_shipping_method()
# Sale order to outside EU
# sale_order = self.env["sale.order"].create(
# {
# "partner_id": self.env.ref("base.res_partner_2").id,
# "date_order": fields.Date.today(),
# "order_line": [
# (
# 0,
# None,
# {
# "product_id": self.env.ref("product.product_product_25").id,
# "product_uom_qty": 1,
# },
# )
# ],
# }
# )
sale_order = self.env.ref("sale.sale_order_1").copy()
europe_codes = self.env.ref("base.europe").country_ids.mapped("code")
partner_country = sale_order.partner_id.country_id.code
Expand Down Expand Up @@ -196,8 +180,7 @@ def rollback():
force_sendcloud_shipment_code="c9b2058d-2621-4ce5-afb0-f14e8e5565b6"
).action_confirm()
# Set HS code and confirm order
sale_order.mapped("order_line").mapped("product_id").write({"hs_code": "123"})
self.assertFalse(self.env.ref("product.product_delivery_02").hs_code)
sale_order.mapped("order_line").mapped("product_id").mapped("product_tmpl_id").write({"hs_code": "123"})
with rollback():
# Origin Country consistency
with self.assertRaisesRegex(
Expand Down Expand Up @@ -407,24 +390,9 @@ def test_09_warehouse_address_wizard(self):
def test_10_auto_create_invoice(self):
"""Test the "Auto create invoice" feature: when shipping outside EU"""
# Sale order to outside EU
sale_order = self.env["sale.order"].create(
{
"partner_id": self.env.ref("base.res_partner_2").id,
"date_order": fields.Date.today(),
"order_line": [
(
0,
None,
{
"product_id": self.env.ref("product.product_product_25").id,
"product_uom_qty": 1,
},
)
],
}
)
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").mapped("product_id").write(
sale_order.mapped("order_line").mapped("product_id").mapped("product_tmpl_id").write(
{
"hs_code": "123",
"country_of_origin": sale_order.warehouse_id.partner_id.country_id,
Expand Down

0 comments on commit a2f72f3

Please sign in to comment.