Fix doctest
This commit is contained in:
parent
005f77e1fd
commit
72772828e3
3
setup.py
3
setup.py
|
@ -122,4 +122,7 @@ setup(name=name,
|
||||||
test_loader='trytond.test_loader:Loader',
|
test_loader='trytond.test_loader:Loader',
|
||||||
tests_require=tests_require,
|
tests_require=tests_require,
|
||||||
use_2to3=True,
|
use_2to3=True,
|
||||||
|
convert_2to3_doctests=[
|
||||||
|
'tests/scenario_sale.rst',
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,7 +9,7 @@ Imports::
|
||||||
>>> from dateutil.relativedelta import relativedelta
|
>>> from dateutil.relativedelta import relativedelta
|
||||||
>>> from decimal import Decimal
|
>>> from decimal import Decimal
|
||||||
>>> from operator import attrgetter
|
>>> from operator import attrgetter
|
||||||
>>> from proteus import config, Model, Wizard, Report
|
>>> from proteus import Model, Wizard, Report
|
||||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||||
... get_company
|
... get_company
|
||||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||||
|
@ -18,11 +18,6 @@ Imports::
|
||||||
... set_fiscalyear_invoice_sequences, create_payment_term
|
... set_fiscalyear_invoice_sequences, create_payment_term
|
||||||
>>> today = datetime.date.today()
|
>>> today = datetime.date.today()
|
||||||
|
|
||||||
Create database::
|
|
||||||
|
|
||||||
>>> config = config.set_trytond()
|
|
||||||
>>> config.pool.test = True
|
|
||||||
|
|
||||||
Install sale::
|
Install sale::
|
||||||
|
|
||||||
>>> config = activate_modules('sale_confirmed2quotation')
|
>>> config = activate_modules('sale_confirmed2quotation')
|
||||||
|
|
|
@ -4,8 +4,7 @@ import unittest
|
||||||
import doctest
|
import doctest
|
||||||
import trytond.tests.test_tryton
|
import trytond.tests.test_tryton
|
||||||
from trytond.tests.test_tryton import ModuleTestCase
|
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, doctest_checker
|
||||||
doctest_checker)
|
|
||||||
|
|
||||||
|
|
||||||
class SaleToQuoteTestCase(ModuleTestCase):
|
class SaleToQuoteTestCase(ModuleTestCase):
|
||||||
|
@ -18,9 +17,10 @@ class SaleToQuoteTestCase(ModuleTestCase):
|
||||||
|
|
||||||
def suite():
|
def suite():
|
||||||
suite = trytond.tests.test_tryton.suite()
|
suite = trytond.tests.test_tryton.suite()
|
||||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(SaleToQuoteTestCase))
|
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||||
|
SaleToQuoteTestCase))
|
||||||
suite.addTests(doctest.DocFileSuite('scenario_sale.rst',
|
suite.addTests(doctest.DocFileSuite('scenario_sale.rst',
|
||||||
setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
|
tearDown=doctest_teardown, encoding='utf-8',
|
||||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE,
|
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE,
|
||||||
checker=doctest_checker))
|
checker=doctest_checker))
|
||||||
return suite
|
return suite
|
||||||
|
|
Loading…
Reference in New Issue