diff --git a/joint_buying_product/demo/joint_buying_transport_request.xml b/joint_buying_product/demo/joint_buying_transport_request.xml index 941a96e7..c54a3c79 100644 --- a/joint_buying_product/demo/joint_buying_transport_request.xml +++ b/joint_buying_product/demo/joint_buying_transport_request.xml @@ -26,4 +26,12 @@ 70 + + + + + 111 + 66 + + diff --git a/joint_buying_product/tests/test_joint_buying_transport_request.py b/joint_buying_product/tests/test_joint_buying_transport_request.py index ec072d85..c621fa64 100644 --- a/joint_buying_product/tests/test_joint_buying_transport_request.py +++ b/joint_buying_product/tests/test_joint_buying_transport_request.py @@ -32,13 +32,14 @@ def test_10_joint_buying_grouped_order_generate_transport_request(self): self.assertFalse(LSE_order.request_id) def test_20_transport_request_vev_cda(self): - self._test_verify_request( + self._verify_tour_lines_computation( "joint_buying_product.request_vev_cda", ["joint_buying_base.tour_lyon_loire_1_line_4"], + "computed", ) def test_21_transport_request_vev_che(self): - self._test_verify_request( + self._verify_tour_lines_computation( "joint_buying_product.request_vev_che", [ "joint_buying_base.tour_lyon_loire_1_line_4", @@ -46,10 +47,11 @@ def test_21_transport_request_vev_che(self): "joint_buying_base.tour_lyon_drome_1_line_2", "joint_buying_base.tour_lyon_drome_1_line_4", ], + "computed", ) def test_22_transport_request_vev_edc(self): - self._test_verify_request( + self._verify_tour_lines_computation( "joint_buying_product.request_vev_edc", [ "joint_buying_base.tour_lyon_loire_1_line_4", @@ -57,9 +59,17 @@ def test_22_transport_request_vev_edc(self): "joint_buying_base.tour_lyon_savoie_1_line_2", "joint_buying_base.tours_savoie_1_line_2", ], + "computed", ) - def _test_verify_request(self, request_xml_id, tour_line_xml_ids): + def test_23_transport_request_vev_fumet(self): + self._verify_tour_lines_computation( + "joint_buying_product.request_vev_fumet_dombes", [], "not_computable" + ) + + def _verify_tour_lines_computation( + self, request_xml_id, tour_line_xml_ids, expected_state + ): transport_request = self.env.ref(request_xml_id) wizard = ( self.env["joint.buying.wizard.find.route"] @@ -73,3 +83,4 @@ def _test_verify_request(self, request_xml_id, tour_line_xml_ids): tour_line_ids.append(self.env.ref(line_xml_id).id) self.assertEqual(transport_request.tour_line_ids.ids, tour_line_ids) + self.assertEqual(transport_request.state, expected_state)