-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] fleet_vehicle_fuel_capacity: Migration to 17.0
- Loading branch information
1 parent
c886dbe
commit de93690
Showing
7 changed files
with
40 additions
and
1 deletion.
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,2 +1,3 @@ | ||
- Marcel Savegnago \<<marcel.savegnago@escodoo.com.br>\> | ||
- Kaynnan Lemes \<<kaynnan.lemes@escodoo.com.br>\> | ||
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) |
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
Binary file not shown.
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,4 @@ | ||
# Copyright 2021 - TODAY, Marcel Savegnago | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_vehicle_fuel_capacity |
32 changes: 32 additions & 0 deletions
32
fleet_vehicle_fuel_capacity/tests/test_vehicle_fuel_capacity.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,32 @@ | ||
# Copyright 2021 - TODAY, Marcel Savegnago | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestFleetVehicleFuelCapacity(TransactionCase): | ||
def setUp(self): | ||
"""Set up initial data for the test cases.""" | ||
super().setUp() | ||
|
||
# Create a vehicle model (you can use a valid brand ID or mock it) | ||
self.vehicle_model = self.env["fleet.vehicle.model"].create( | ||
{ | ||
"name": "Model Name", | ||
"brand_id": 1, # Assuming brand_id 1 exists | ||
} | ||
) | ||
|
||
def test_valid_fuel_capacity(self): | ||
"""Test if a vehicle can be created with a valid fuel capacity.""" | ||
vehicle = self.env["fleet.vehicle"].create( | ||
{ | ||
"model_id": self.vehicle_model.id, | ||
"fuel_capacity": 50.0, # Valid fuel capacity | ||
} | ||
) | ||
|
||
self.assertEqual( | ||
vehicle.fuel_capacity, 50.0, "The fuel capacity should be 50.0 liters." | ||
) |