-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] joint.buying.wizard.find.route 1er implementation to find route
- Loading branch information
1 parent
0269c92
commit 02a8cc6
Showing
7 changed files
with
263 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from . import test_abstract | ||
from . import test_joint_buying_purchase_order | ||
from . import test_joint_buying_transport_request | ||
from . import test_joint_buying_wizard_find_route | ||
from . import test_product | ||
from . import test_check_access_product | ||
from . import test_check_access_joint_buying_purchase |
68 changes: 68 additions & 0 deletions
68
joint_buying_product/tests/test_joint_buying_wizard_find_route.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright (C) 2023 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
from odoo.tests import tagged | ||
|
||
from .test_abstract import TestAbstract | ||
|
||
|
||
@tagged("post_install", "-at_install") | ||
class TestJointBuyingWizardFindRoute(TestAbstract): | ||
def setUp(self): | ||
super().setUp() | ||
|
||
def test_20_transport_request_vev_cda(self): | ||
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._verify_tour_lines_computation( | ||
"joint_buying_product.request_vev_che", | ||
[ | ||
"joint_buying_base.tour_lyon_loire_1_line_4", | ||
"joint_buying_base.tour_lyon_loire_1_line_6", | ||
"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._verify_tour_lines_computation( | ||
"joint_buying_product.request_vev_edc", | ||
[ | ||
"joint_buying_base.tour_lyon_loire_1_line_4", | ||
"joint_buying_base.tour_lyon_loire_1_line_6", | ||
"joint_buying_base.tour_lyon_savoie_1_line_2", | ||
"joint_buying_base.tours_savoie_1_line_2", | ||
], | ||
"computed", | ||
) | ||
|
||
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"] | ||
.with_context(active_id=transport_request.id) | ||
.create({}) | ||
) | ||
wizard.button_apply() | ||
|
||
tour_line_ids = [] | ||
for line_xml_id in 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ bokeh==1.1.0 | |
geopy | ||
openupgradelib | ||
pandas | ||
treelib |