mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: Make price test more deterministic
As this uses demo data, it may returns an invalid price.
This commit is contained in:
@@ -27,10 +27,11 @@ class TestContractBase(common.SavepointCase):
|
|||||||
)
|
)
|
||||||
# For being sure of the applied price
|
# For being sure of the applied price
|
||||||
cls.env['product.pricelist.item'].create({
|
cls.env['product.pricelist.item'].create({
|
||||||
|
'applied_on': '0_product_variant',
|
||||||
'pricelist_id': cls.partner.property_product_pricelist.id,
|
'pricelist_id': cls.partner.property_product_pricelist.id,
|
||||||
'product_id': cls.product.id,
|
'product_id': cls.product.id,
|
||||||
'compute_price': 'formula',
|
'compute_price': 'fixed',
|
||||||
'base': 'list_price',
|
'fixed_price': 1100,
|
||||||
})
|
})
|
||||||
cls.contract = cls.env['account.analytic.account'].create({
|
cls.contract = cls.env['account.analytic.account'].create({
|
||||||
'name': 'Test Contract',
|
'name': 'Test Contract',
|
||||||
@@ -69,7 +70,6 @@ class TestContract(TestContractBase):
|
|||||||
|
|
||||||
def test_automatic_price(self):
|
def test_automatic_price(self):
|
||||||
self.acct_line.automatic_price = True
|
self.acct_line.automatic_price = True
|
||||||
self.product.list_price = 1100
|
|
||||||
self.assertEqual(self.acct_line.price_unit, 1100)
|
self.assertEqual(self.acct_line.price_unit, 1100)
|
||||||
# Try to write other price
|
# Try to write other price
|
||||||
self.acct_line.price_unit = 10
|
self.acct_line.price_unit = 10
|
||||||
|
|||||||
Reference in New Issue
Block a user