Use install_modules tools in scenario
issue5794
This commit is contained in:
@@ -8,32 +8,20 @@ Imports::
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> from trytond.tests.tools import install_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install stock_lot Module::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> module, = Module.find([('name', '=', 'stock_lot')])
|
||||
>>> module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
>>> config = install_modules('stock_lot')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create customer::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
|
||||
@@ -8,7 +8,7 @@ from decimal import Decimal
|
||||
|
||||
import trytond.tests.test_tryton
|
||||
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
|
||||
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
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
@@ -229,7 +229,7 @@ def suite():
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
StockLotTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_stock_lot_shipment_out.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