Files
contract/agreement_serviceprofile/tests/test_product.py
Patrick Wilson ef2dc5345f [14.0][MIG] agreement_serviceprofile (Version 12.0 to 14.0)
[MIG] Black

[MIG] Black
2021-07-06 08:09:01 -06:00

27 lines
948 B
Python

# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import TransactionCase
class TestProduct(TransactionCase):
def setUp(self):
super().setUp()
self.test_product1 = self.env["product.template"].create(
{"name": "TestProduct"}
)
self.test_product2 = self.env["product.product"].create({"name": "TestProduct"})
# TEST 01: Test onchange_type product.template
def test_product_template_onchange_type(self):
product_01 = self.test_product1
product_01.is_serviceprofile = True
product_01.onchange_type()
self.assertEqual(product_01.type, "service")
# TEST 02: Test onchange_type product.product
def test_product_product_onchange_type(self):
product_02 = self.test_product2
product_02.is_serviceprofile = True
product_02.onchange_type()
self.assertEqual(product_02.type, "service")