Use install_modules tools in scenario
issue5794
This commit is contained in:
1 parent
ecba67ed84
commit
b79560bf6d
2 files changed
+8
-20
No files matched your search
@@ -7,7 +7,8 @@ Imports::
|
||||
>>> import datetime
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import install_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
@@ -16,32 +17,19 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install sale_shipment_cost, sale and account_invoice::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', 'in', ('sale_shipment_cost',
|
||||
... 'sale', 'account_invoice')),
|
||||
>>> config = install_modules([
|
||||
... 'sale_shipment_cost',
|
||||
... 'sale',
|
||||
... 'account_invoice',
|
||||
... ])
|
||||
>>> for module in modules:
|
||||
... module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
|
||||
@@ -4,7 +4,7 @@ import unittest
|
||||
import doctest
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
|
||||
from trytond.tests.test_tryton import doctest_teardown
|
||||
from trytond.tests.test_tryton import doctest_checker
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ def suite():
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
SaleShipmentCostTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_sale_shipment_cost.rst',
|
||||
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
|
||||
tearDown=doctest_teardown, encoding='utf-8',
|
||||
checker=doctest_checker,
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
|
||||
return suite
|
||||
Reference in new issue
Block a user