Add test scenario for empty purchase
issue6639 review37571002
This commit is contained in:
@@ -124,6 +124,7 @@ setup(name=name,
|
||||
use_2to3=True,
|
||||
convert_2to3_doctests=[
|
||||
'tests/scenario_purchase.rst',
|
||||
'tests/scenario_purchase_empty.rst',
|
||||
],
|
||||
tests_require=tests_require,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
=======================
|
||||
Purchase Empty Scenario
|
||||
=======================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
>>> from trytond.modules.company.tests.tools import create_company, \
|
||||
... get_company
|
||||
>>> from trytond.modules.account.tests.tools import create_fiscalyear, \
|
||||
... create_chart
|
||||
|
||||
Install purchase::
|
||||
|
||||
>>> config = activate_modules('purchase')
|
||||
|
||||
Create company::
|
||||
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Create chart of accounts::
|
||||
|
||||
>>> _ = create_chart(company)
|
||||
|
||||
Create parties::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> supplier = Party(name='Supplier')
|
||||
>>> supplier.save()
|
||||
|
||||
Create empty purchase::
|
||||
|
||||
>>> Purchase = Model.get('purchase.purchase')
|
||||
>>> purchase = Purchase()
|
||||
>>> purchase.party = supplier
|
||||
>>> purchase.click('quote')
|
||||
>>> purchase.state
|
||||
u'quotation'
|
||||
>>> purchase.untaxed_amount
|
||||
Decimal('0')
|
||||
>>> purchase.tax_amount
|
||||
Decimal('0')
|
||||
>>> purchase.total_amount
|
||||
Decimal('0')
|
||||
>>> purchase.click('confirm')
|
||||
>>> purchase.state
|
||||
u'confirmed'
|
||||
>>> purchase.click('process')
|
||||
>>> purchase.state
|
||||
u'done'
|
||||
>>> purchase.shipment_state
|
||||
u'none'
|
||||
>>> len(purchase.moves)
|
||||
0
|
||||
>>> len(purchase.shipment_returns)
|
||||
0
|
||||
>>> purchase.invoice_state
|
||||
u'none'
|
||||
>>> len(purchase.invoices)
|
||||
0
|
||||
@@ -111,4 +111,8 @@ def suite():
|
||||
tearDown=doctest_teardown, encoding='UTF-8',
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE,
|
||||
checker=doctest_checker))
|
||||
suite.addTests(doctest.DocFileSuite('scenario_purchase_empty.rst',
|
||||
tearDown=doctest_teardown, encoding='UTF-8',
|
||||
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE,
|
||||
checker=doctest_checker))
|
||||
return suite
|
||||
|
||||
Reference in New Issue
Block a user