Initial import from Docker volume
This commit is contained in:
2
modules/stock_inventory_location/tests/__init__.py
Executable file
2
modules/stock_inventory_location/tests/__init__.py
Executable 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.
BIN
modules/stock_inventory_location/tests/__pycache__/__init__.cpython-311.pyc
Executable file
BIN
modules/stock_inventory_location/tests/__pycache__/__init__.cpython-311.pyc
Executable file
Binary file not shown.
Binary file not shown.
BIN
modules/stock_inventory_location/tests/__pycache__/test_module.cpython-311.pyc
Executable file
BIN
modules/stock_inventory_location/tests/__pycache__/test_module.cpython-311.pyc
Executable file
Binary file not shown.
Binary file not shown.
BIN
modules/stock_inventory_location/tests/__pycache__/test_scenario.cpython-311.pyc
Executable file
BIN
modules/stock_inventory_location/tests/__pycache__/test_scenario.cpython-311.pyc
Executable file
Binary file not shown.
38
modules/stock_inventory_location/tests/scenario_stock_inventories.rst
Executable file
38
modules/stock_inventory_location/tests/scenario_stock_inventories.rst
Executable file
@@ -0,0 +1,38 @@
|
||||
==========================
|
||||
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::
|
||||
|
||||
>>> _ = 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
Executable file
13
modules/stock_inventory_location/tests/test_module.py
Executable 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
Executable file
8
modules/stock_inventory_location/tests/test_scenario.py
Executable 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