From b0a474bf38b9c605ae9d4e4e0e721d147ff25eba Mon Sep 17 00:00:00 2001 From: Benoit Aimont Date: Mon, 26 Apr 2021 10:07:06 +0200 Subject: [PATCH] [TESTS] fieldservice_purchase --- fieldservice_purchase/tests/__init__.py | 1 + .../tests/test_fieldservice_purchase.py | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 fieldservice_purchase/tests/__init__.py create mode 100644 fieldservice_purchase/tests/test_fieldservice_purchase.py diff --git a/fieldservice_purchase/tests/__init__.py b/fieldservice_purchase/tests/__init__.py new file mode 100644 index 0000000000..8851092fed --- /dev/null +++ b/fieldservice_purchase/tests/__init__.py @@ -0,0 +1 @@ +from . import test_fieldservice_purchase diff --git a/fieldservice_purchase/tests/test_fieldservice_purchase.py b/fieldservice_purchase/tests/test_fieldservice_purchase.py new file mode 100644 index 0000000000..478c656980 --- /dev/null +++ b/fieldservice_purchase/tests/test_fieldservice_purchase.py @@ -0,0 +1,26 @@ +# Copyright 2021 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import SavepointCase + + +class TestFieldservicePurchase(SavepointCase): + @classmethod + def setUpClass(cls): + super(TestFieldservicePurchase, cls).setUpClass() + cls.Pricelist = cls.env["product.supplierinfo"] + Partner = cls.env["res.partner"] + FSMPerson = cls.env["fsm.person"] + cls.vendor = Partner.create({"name": "vendor test"}) + cls.worker = FSMPerson.create( + {"name": "worker test", "partner_id": cls.vendor.id} + ) + + def test_pricelist_count(self): + Pricelist = self.Pricelist + vendor = self.vendor + worker = self.worker + self.assertEqual(worker.pricelist_count, 0) + Pricelist.create({"name": vendor.id}) + worker.invalidate_cache() + self.assertEqual(worker.pricelist_count, 1)