Skip to content

Commit

Permalink
[TESTS] fieldservice_purchase
Browse files Browse the repository at this point in the history
  • Loading branch information
baimont committed Apr 26, 2021
1 parent 035541c commit b0a474b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions fieldservice_purchase/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_fieldservice_purchase
26 changes: 26 additions & 0 deletions fieldservice_purchase/tests/test_fieldservice_purchase.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b0a474b

Please sign in to comment.