Skip to content

Commit

Permalink
Merge pull request #1558 from VoicuStefan2001/16.0-upd-deltatech_data…
Browse files Browse the repository at this point in the history
…_sheet

[16.0][UPD] deltatech_data_sheet tests
  • Loading branch information
VoicuStefan2001 authored Jul 15, 2024
2 parents d64b9f9 + db65535 commit 75bbc0b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions deltatech_data_sheet/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_data_sheet
36 changes: 36 additions & 0 deletions deltatech_data_sheet/tests/test_data_sheet.py
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)

0 comments on commit 75bbc0b

Please sign in to comment.