diff --git a/tests/test_stock.py b/tests/test_stock.py index 184544f51c..950b128cca 100644 --- a/tests/test_stock.py +++ b/tests/test_stock.py @@ -8,7 +8,8 @@ from dateutil.relativedelta import relativedelta from functools import partial import trytond.tests.test_tryton from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\ - test_depends, doctest_dropdb + test_depends +from trytond.tests.test_tryton import doctest_setup, doctest_teardown from trytond.transaction import Transaction from trytond.exceptions import UserWarning @@ -668,17 +669,17 @@ def suite(): suite.addTest(test) suite.addTests(unittest.TestLoader().loadTestsFromTestCase(StockTestCase)) suite.addTests(doctest.DocFileSuite('scenario_stock_shipment_out.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite( 'scenario_stock_average_cost_price.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite( 'scenario_stock_inventory.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) suite.addTests(doctest.DocFileSuite('scenario_stock_shipment_internal.rst', - setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8', + setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) return suite