-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1558 from VoicuStefan2001/16.0-upd-deltatech_data…
…_sheet [16.0][UPD] deltatech_data_sheet tests
- Loading branch information
Showing
2 changed files
with
37 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_data_sheet |
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,36 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestProductTemplate(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
|
||
# Create necessary records for the test | ||
self.attachment_1 = self.env["ir.attachment"].create( | ||
{ | ||
"name": "Test Data Sheet", | ||
"mimetype": "application/pdf", | ||
"public": True, | ||
} | ||
) | ||
|
||
self.attachment_2 = self.env["ir.attachment"].create( | ||
{ | ||
"name": "Test Safety Data Sheet", | ||
"mimetype": "application/pdf", | ||
"public": True, | ||
} | ||
) | ||
|
||
self.product_template = self.env["product.template"].create( | ||
{ | ||
"name": "Test Product", | ||
"data_sheet_id": self.attachment_1.id, | ||
"safety_data_sheet_id": self.attachment_2.id, | ||
} | ||
) | ||
|
||
def test_product_template(self): | ||
# Check that the product template was created with the correct data sheet and safety data sheet | ||
self.assertEqual(self.product_template.data_sheet_id, self.attachment_1) | ||
self.assertEqual(self.product_template.safety_data_sheet_id, self.attachment_2) |