Use install_modules tools in scenario
issue5794
This commit is contained in:
@@ -7,36 +7,21 @@ 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
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install purchase_shipment_cost::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', '=', 'purchase_shipment_cost'),
|
||||
... ])
|
||||
>>> for module in modules:
|
||||
... module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
>>> config = install_modules('purchase_shipment_cost')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> config._context = User.get_preferences(True, config.context)
|
||||
|
||||
Create supplier::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
|
||||
@@ -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, \
|
||||
@@ -18,32 +19,18 @@ Imports::
|
||||
... add_stock_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
Install purchase_shipment_cost and account_stock_continental::
|
||||
|
||||
>>> config = config.set_trytond()
|
||||
>>> config.pool.test = True
|
||||
|
||||
Install purchase_shipment_cost::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', 'in', ['purchase_shipment_cost',
|
||||
... 'account_stock_continental']),
|
||||
>>> config = install_modules([
|
||||
... 'purchase_shipment_cost',
|
||||
... 'account_stock_continental',
|
||||
... ])
|
||||
>>> 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 = create_fiscalyear(company)
|
||||
|
||||
@@ -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, \
|
||||
@@ -20,44 +21,19 @@ Imports::
|
||||
... add_cogs_accounts
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
||||
>>> current_config = config.set_trytond()
|
||||
>>> current_config.pool.test = True
|
||||
|
||||
Install purchase_shipment_cost, account_stock_continental and purchase::
|
||||
|
||||
>>> Module = Model.get('ir.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', 'in', ('purchase_shipment_cost',
|
||||
... 'account_stock_anglo_saxon', 'purchase')),
|
||||
... ])
|
||||
>>> for module in modules:
|
||||
... module.click('install')
|
||||
>>> Wizard('ir.module.install_upgrade').execute('upgrade')
|
||||
>>> config = install_modules([
|
||||
... 'purchase_shipment_cost',
|
||||
... 'account_stock_anglo_saxon',
|
||||
... 'purchase',
|
||||
... ])
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Reload the context::
|
||||
|
||||
>>> User = Model.get('res.user')
|
||||
>>> current_config._context = User.get_preferences(True,
|
||||
... current_config.context)
|
||||
|
||||
Create an accountant user::
|
||||
|
||||
>>> Group = Model.get('res.group')
|
||||
>>> accountant = User()
|
||||
>>> accountant.name = 'Accountant'
|
||||
>>> accountant.login = 'accountant'
|
||||
>>> accountant.password = 'accountant'
|
||||
>>> account_group, = Group.find([('name', '=', 'Account')])
|
||||
>>> accountant.groups.append(account_group)
|
||||
>>> accountant.save()
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(
|
||||
|
||||
@@ -5,7 +5,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
|
||||
|
||||
|
||||
@@ -19,17 +19,17 @@ def suite():
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
PurchaseShipmentCostTestCase))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_purchase_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))
|
||||
suite.addTests(doctest.DocFileSuite(
|
||||
'scenario_purchase_shipment_cost_with_account_stock.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))
|
||||
suite.addTests(doctest.DocFileSuite(
|
||||
'scenario_purchase_shipment_cost_with_account_stock_anglo_saxon.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