-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68d9f21
commit fdc2c42
Showing
2 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_stock_dock |
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,25 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestStockDock(TransactionCase): | ||
def test_default_warehouse_id(self): | ||
# Retrieve the default warehouse using the reference defined in the data. | ||
default_warehouse = self.env.ref("stock.warehouse0", raise_if_not_found=False) | ||
|
||
# Assert that the default warehouse exists. | ||
self.assertTrue(default_warehouse, "Default warehouse not found.") | ||
|
||
# Create a new stock.dock record without specifying a warehouse_id. | ||
dock = self.env["stock.dock"].create( | ||
{ | ||
"name": "Test Dock", | ||
} | ||
) | ||
|
||
# Assert that the warehouse_id of the newly created dock | ||
# is set to the default warehouse. | ||
self.assertEqual( | ||
dock.warehouse_id, | ||
default_warehouse, | ||
"Default warehouse is not set correctly.", | ||
) |