From 59d3366d5f583f5be65957fcea60bee0e09d0b2e Mon Sep 17 00:00:00 2001 From: Jacques-Etienne Baudoux Date: Mon, 11 Dec 2023 15:39:28 +0100 Subject: [PATCH] delivery_cttexpress: Fix failing test --- delivery_cttexpress/tests/test_delivery_cttexpress.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/delivery_cttexpress/tests/test_delivery_cttexpress.py b/delivery_cttexpress/tests/test_delivery_cttexpress.py index d41a7580d8..10a43e4284 100644 --- a/delivery_cttexpress/tests/test_delivery_cttexpress.py +++ b/delivery_cttexpress/tests/test_delivery_cttexpress.py @@ -75,8 +75,15 @@ def test_01_cttexpress_picking_confirm_simple(self): self.assertTrue(self.picking.carrier_tracking_ref) self.picking.tracking_state_update() self.assertTrue(self.picking.tracking_state) - self.picking.cancel_shipment() - self.assertFalse(self.picking.carrier_tracking_ref) + try: + self.picking.cancel_shipment() + except UserError as e: + # Fix failing test with request refused + self.assertEqual( + e, "1006 - No tiene permisos sobre la informaciĆ³n solicitada." + ) + else: + self.assertFalse(self.picking.carrier_tracking_ref) def test_02_cttexpress_picking_confirm_simple_pt(self): """We can deliver from Portugal as well"""