first commit
This commit is contained in:
23
modules/currency/tests/scenario_currency_compute.rst
Normal file
23
modules/currency/tests/scenario_currency_compute.rst
Normal file
@@ -0,0 +1,23 @@
|
||||
=========================
|
||||
Currency Compute Scenario
|
||||
=========================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.modules.currency.tests.tools import get_currency
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('currency')
|
||||
|
||||
Call compute::
|
||||
|
||||
>>> Currency = Model.get('currency.currency')
|
||||
>>> usd = get_currency(code='USD')
|
||||
>>> eur = get_currency(code='EUR')
|
||||
>>> Currency.compute(usd.id, Decimal('10.00'), eur.id, {})
|
||||
Decimal('20.00')
|
||||
Reference in New Issue
Block a user