mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 19:50:59 +00:00
Refactored Stock test to use fixtures
This commit is contained in:
@ -26,6 +26,18 @@
|
||||
- model: stock.stocklocation
|
||||
pk: 5
|
||||
fields:
|
||||
name: 'Drawer'
|
||||
name: 'Drawer_1'
|
||||
description: 'In my desk'
|
||||
parent: 4
|
||||
- model: stock.stocklocation
|
||||
pk: 6
|
||||
fields:
|
||||
name: 'Drawer_2'
|
||||
description: 'Also in my desk'
|
||||
parent: 4
|
||||
- model: stock.stocklocation
|
||||
pk: 7
|
||||
fields:
|
||||
name: 'Drawer_3'
|
||||
description: 'Again, in my desk'
|
||||
parent: 4
|
42
InvenTree/stock/fixtures/stock.yaml
Normal file
42
InvenTree/stock/fixtures/stock.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
# Create some sample stock items
|
||||
|
||||
# 4,000 screws in the dining room
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 1
|
||||
location: 3
|
||||
batch: 'B123'
|
||||
quantity: 4000
|
||||
|
||||
# 5,000 screws in the bathroom
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 1
|
||||
location: 2
|
||||
quantity: 5000
|
||||
|
||||
# 1234 2K2 resistors in 'Drawer_1'
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 3
|
||||
location: 5
|
||||
quantity: 1234
|
||||
|
||||
# Some widgets in drawer 3
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 25
|
||||
location: 7
|
||||
quantity: 10
|
||||
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 25
|
||||
location: 7
|
||||
quantity: 5
|
||||
|
||||
- model: stock.stockitem
|
||||
fields:
|
||||
part: 25
|
||||
location: 7
|
||||
quantity: 3
|
Reference in New Issue
Block a user