From 5df1094b84f7ffa948963ccde8e2fa1bcac6882c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 2 Aug 2017 19:38:22 +0200 Subject: [PATCH] Add set_user tools for test scenario When changing the user of proteus, the context should be reloaded. issue6652 review42551002 --- tests/scenario_sale_price_list.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/scenario_sale_price_list.rst b/tests/scenario_sale_price_list.rst index a548ab3664..1ba48f7b98 100644 --- a/tests/scenario_sale_price_list.rst +++ b/tests/scenario_sale_price_list.rst @@ -7,7 +7,7 @@ Imports:: >>> import datetime >>> 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 >>> from trytond.modules.account.tests.tools import create_fiscalyear, \ @@ -121,7 +121,7 @@ Create a price List and assign it to customer:: Use the price list on sale:: - >>> config.user = sale_user.id + >>> set_user(sale_user) >>> Sale = Model.get('sale.sale') >>> sale = Sale() >>> sale.party = customer @@ -145,7 +145,7 @@ Use the price list on sale:: Create a sale price List and assign to configuration:: - >>> config.user = sale_admin.id + >>> set_user(sale_admin) >>> sale_price_list = PriceList(name='Sale price List') >>> sale_price_list_line = sale_price_list.lines.new() >>> sale_price_list_line.formula = 'unit_price * 0.5' @@ -157,7 +157,7 @@ Create a sale price List and assign to configuration:: Use the sale price list on sale:: - >>> config.user = sale_user.id + >>> set_user(sale_user) >>> sale.party = customer_without_price_list >>> sale.price_list == sale_price_list True