mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[14.0][MIG]agreement_maintenance: migrated to v14
This commit is contained in:
3
agreement_maintenance/tests/__init__.py
Normal file
3
agreement_maintenance/tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
|
||||
|
||||
from . import test_agreement_maintenance
|
||||
34
agreement_maintenance/tests/test_agreement_maintenance.py
Normal file
34
agreement_maintenance/tests/test_agreement_maintenance.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# Copyright (C) 2021 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import odoo.tests.common as common
|
||||
from odoo import fields
|
||||
|
||||
|
||||
class TestAgreementMaintenance(common.TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestAgreementMaintenance, self).setUp()
|
||||
|
||||
self.agreement_obj = self.env["agreement"]
|
||||
self.agreement_type_id = self.env["agreement.type"].create(
|
||||
{"name": "Test Agreement Type", "active": True}
|
||||
)
|
||||
self.product = self.env.ref("product.product_product_8_product_template")
|
||||
|
||||
def test_fieldservice_purchase(self):
|
||||
agreement_vals = {
|
||||
"name": "Test Agreement",
|
||||
"agreement_type_id": self.agreement_type_id.id,
|
||||
"description": "Test Agreement",
|
||||
"start_date": fields.Date.today(),
|
||||
"end_date": fields.Date.today(),
|
||||
}
|
||||
agreement = self.agreement_obj.create(agreement_vals)
|
||||
|
||||
maintenance_req = self.env.ref("maintenance.m_request_7")
|
||||
maintenance_req.write({"agreement_id": agreement.id})
|
||||
|
||||
agreement._compute_mr_count()
|
||||
self.assertEqual(
|
||||
agreement.mr_count, 1, "Wrong no of Maintenance Request Count!"
|
||||
)
|
||||
Reference in New Issue
Block a user