-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] delivery_carrier_partner: adding simply test for partner associ…
…ation
- Loading branch information
Showing
2 changed files
with
36 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_delivery_carrier_partner |
35 changes: 35 additions & 0 deletions
35
delivery_carrier_partner/tests/test_delivery_carrier_partner.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,35 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestDeliveryCarrierPartner(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
|
||
self.partner = self.env["res.partner"].create( | ||
{ | ||
"name": "Transporter Test", | ||
"email": "[email protected]", | ||
} | ||
) | ||
|
||
self.product = self.env["product.product"].create( | ||
{ | ||
"name": "Product Test", | ||
} | ||
) | ||
|
||
self.delivery_carrier = self.env["delivery.carrier"].create( | ||
{ | ||
"name": "Carrier Test", | ||
"product_id": self.product.id, | ||
"partner_id": self.partner.id, | ||
} | ||
) | ||
|
||
def test_partner_association(self): | ||
"""Test to verify the correct association of a partner with a carrier.""" | ||
self.assertEqual( | ||
self.delivery_carrier.partner_id.id, | ||
self.partner.id, | ||
"The partner was not correctly associated with the delivery carrier.", | ||
) |