first commit
This commit is contained in:
2
modules/stock_inventory_location/tests/__init__.py
Normal file
2
modules/stock_inventory_location/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.
@@ -0,0 +1,34 @@
|
||||
==========================
|
||||
Stock Inventories Scenario
|
||||
==========================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.modules.company.tests.tools import create_company
|
||||
>>> from trytond.tests.tools import activate_modules, assertEqual
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('stock_inventory_location', create_company)
|
||||
|
||||
Get stock locations::
|
||||
|
||||
>>> Location = Model.get('stock.location')
|
||||
>>> supplier_loc, = Location.find([('code', '=', 'SUP')])
|
||||
>>> storage_loc, = Location.find([('code', '=', 'STO')])
|
||||
>>> storage_loc2, = storage_loc.duplicate()
|
||||
|
||||
Create inventories::
|
||||
|
||||
>>> create = Wizard('stock.inventory.create')
|
||||
>>> create.form.empty_quantity = 'keep'
|
||||
>>> create.form.locations.extend(Location.find([('code', '=', 'STO')]))
|
||||
>>> create.execute('create_')
|
||||
|
||||
>>> inventories, = create.actions
|
||||
>>> len(inventories)
|
||||
2
|
||||
>>> assertEqual({i.location for i in inventories}, {storage_loc, storage_loc2})
|
||||
>>> inventories[0].empty_quantity
|
||||
'keep'
|
||||
13
modules/stock_inventory_location/tests/test_module.py
Normal file
13
modules/stock_inventory_location/tests/test_module.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# 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.modules.company.tests import CompanyTestMixin
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class StockInventoryLocationTestCase(CompanyTestMixin, ModuleTestCase):
|
||||
'Test StockInventoryLocation module'
|
||||
module = 'stock_inventory_location'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/stock_inventory_location/tests/test_scenario.py
Normal file
8
modules/stock_inventory_location/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