Skip to content

Commit

Permalink
[ADD] delivery_carrier_partner: adding simply test for partner associ…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
Borruso committed Nov 22, 2024
1 parent 8595a9c commit 145140f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions delivery_carrier_partner/tests/__init__.py
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 delivery_carrier_partner/tests/test_delivery_carrier_partner.py
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.",
)

0 comments on commit 145140f

Please sign in to comment.