mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_widget_uom
This commit is contained in:
1
web_widget_uom/tests/__init__.py
Normal file
1
web_widget_uom/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_decimal_precision
|
||||
14
web_widget_uom/tests/test_decimal_precision.py
Normal file
14
web_widget_uom/tests/test_decimal_precision.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestWebWidgetUom(common.TransactionCase):
|
||||
def test_web_widget_uom(self):
|
||||
Uom = self.env["uom.uom"]
|
||||
uom_unit = self.env.ref("uom.product_uom_unit")
|
||||
|
||||
uom_unit.write({"decimal_places": 5})
|
||||
self.assertTrue(isinstance(uom_unit._onchange_decimal_places(), dict))
|
||||
self.assertEqual(Uom.get_decimal_places(uom_unit.id, 0.1234567), 5)
|
||||
|
||||
uom_unit.write({"show_only_inputed_decimals": True})
|
||||
self.assertEqual(Uom.get_decimal_places(uom_unit.id, 0.1), 1)
|
||||
Reference in New Issue
Block a user