Commit 88fe4225 authored by Jérome Perrin's avatar Jérome Perrin

test for getQuantityPrecision was missing

fix some indentations


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10276 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e705498f
......@@ -746,6 +746,18 @@ class TestResource(ERP5TypeTestCase):
self.assertEquals(base_price,
product.getPrice())
def testQuantityPrecision(self):
"""test how to define quantity precision on resources.
"""
resource = self.portal.getDefaultModule(self.product_portal_type)\
.newContent(portal_type=self.product_portal_type)
# default is 1
self.assertEquals(1, resource.getBaseUnitQuantity())
self.assertEquals(0, resource.getQuantityPrecision())
# quantity precision is calculated using base quantity unit
resource.setBaseUnitQuantity(0.001)
self.assertEquals(3, resource.getQuantityPrecision())
if __name__ == '__main__':
framework()
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment