first commit
This commit is contained in:
2
modules/purchase_history/tests/__init__.py
Normal file
2
modules/purchase_history/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
42
modules/purchase_history/tests/scenario_purchase_history.rst
Normal file
42
modules/purchase_history/tests/scenario_purchase_history.rst
Normal file
@@ -0,0 +1,42 @@
|
||||
=========================
|
||||
Purchase History Scenario
|
||||
=========================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.modules.company.tests.tools import create_company
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('purchase_history', create_company)
|
||||
|
||||
Create supplier::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> supplier = Party(name='Supplier')
|
||||
>>> supplier.save()
|
||||
|
||||
Create a purchase::
|
||||
|
||||
>>> Purchase = Model.get('purchase.purchase')
|
||||
>>> purchase = Purchase()
|
||||
>>> purchase.party = supplier
|
||||
>>> purchase.click('quote')
|
||||
|
||||
>>> purchase.number
|
||||
'1'
|
||||
>>> purchase.revision
|
||||
0
|
||||
>>> purchase.rec_name
|
||||
'1'
|
||||
|
||||
Reset to draft increases revision::
|
||||
|
||||
>>> purchase.click('draft')
|
||||
|
||||
>>> purchase.revision
|
||||
1
|
||||
>>> purchase.rec_name
|
||||
'1/1'
|
||||
12
modules/purchase_history/tests/test_module.py
Normal file
12
modules/purchase_history/tests/test_module.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class PurchaseHistoryTestCase(ModuleTestCase):
|
||||
'Test Purchase History module'
|
||||
module = 'purchase_history'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/purchase_history/tests/test_scenario.py
Normal file
8
modules/purchase_history/tests/test_scenario.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
Reference in New Issue
Block a user