Use install_modules tools in scenario
issue5794
This commit is contained in:
1 parent
ed3cdd29fb
commit
2ee3bc981b
2 files changed
+6
-23
No files matched your search
@@ -9,7 +9,8 @@ Imports::
|
||||
>>> from dateutil.relativedelta import relativedelta
|
||||
>>> from decimal import Decimal
|
||||
>>> from operator import attrgetter
|
||||
>>> from proteus import config, Model, Wizard, Report
|
||||
>>> from proteus import Model, Wizard, Report
|
||||
>>> 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, \
|
||||
@@ -18,32 +19,15 @@ Imports::
|
||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
Install stock_package_shipping_dpd and sale::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install stock_package_shipping_dpd::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> shipping_module, = Module.find([
|
||||
... ('name', '=', 'stock_package_shipping_dpd')])
|
||||
>>> shipping_module.click('install')
|
||||
>>> sale_module, = Module.find([('name', '=', 'sale')])
|
||||
>>> sale_module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
>>> config = install_modules(['stock_package_shipping_dpd', 'sale'])
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> Group = Model.get('res.group')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
|
||||
@@ -6,8 +6,7 @@ import doctest
|
||||
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
from trytond.tests.test_tryton import suite as test_suite
|
||||
from trytond.tests.test_tryton import (doctest_setup, doctest_teardown,
|
||||
doctest_checker)
|
||||
from trytond.tests.test_tryton import doctest_teardown, doctest_checker
|
||||
|
||||
|
||||
class StockPackageShippingDpdTestCase(ModuleTestCase):
|
||||
@@ -20,7 +19,7 @@ def suite():
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
StockPackageShippingDpdTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_shipping_dpd.rst',
|
||||
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
|
||||
tearDown=doctest_teardown, encoding='utf-8',
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE,
|
||||
checker=doctest_checker))
|
||||
return suite
|
||||
Reference in new issue
Block a user