Add set_user tools for test scenario

When changing the user of proteus, the context should be reloaded.

issue6652
review42551002
This commit is contained in:
Cédric Krier committed 2017-08-02 19:38:23 +02:00
1 parent 6a655d5a58
commit 54ccd5b967
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -8,7 +8,7 @@ Imports::
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from proteus import Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.tests.tools import activate_modules, set_user
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> today = datetime.date.today()
@@ -68,7 +68,7 @@ Create stock user::
Create Internal Shipment::
>>> config.user = stock_user.id
>>> set_user(stock_user)
>>> Shipment = Model.get('stock.shipment.internal')
>>> StockMove = Model.get('stock.move')
>>> shipment = Shipment()
@@ -133,7 +133,7 @@ Check that now whe can finish the older shipment::
Add lead time inside the warehouse::
>>> config.user = 1
>>> set_user(1)
>>> LeadTime = Model.get('stock.location.lead_time')
>>> lead_time = LeadTime()
>>> lead_time.from_warehouse = storage_loc.warehouse
@@ -143,7 +143,7 @@ Add lead time inside the warehouse::
Create Internal Shipment with lead time::
>>> config.user = stock_user.id
>>> set_user(stock_user)
>>> shipment = Shipment()
>>> shipment.planned_date = tomorrow
>>> shipment.from_location = internal_loc
+2 -2
View File
@@ -8,7 +8,7 @@ Imports::
>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> from proteus import Model, Wizard
>>> from trytond.tests.tools import activate_modules
>>> from trytond.tests.tools import activate_modules, set_user
>>> from trytond.modules.company.tests.tools import create_company, \
... get_company
>>> today = datetime.date.today()
@@ -63,7 +63,7 @@ Create stock user::
>>> stock_user.employee = employee
>>> stock_user.save()
>>> config.user = stock_user.id
>>> set_user(stock_user)
Get stock locations::