refactor(test): flaky pos invoice test; load stock entry json

This commit is contained in:
ruthra kumar
2025-06-21 07:48:32 +05:30
parent a5a6a3bc9c
commit 0914fd695d
2 changed files with 106 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ class TestPOSInvoice(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.load_test_records("Stock Entry")
cls.enterClassContext(cls.change_settings("Selling Settings", validate_selling_price=0))
cls.enterClassContext(cls.change_settings("POS Settings", invoice_type="POS Invoice"))
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100)

View File

@@ -0,0 +1,105 @@
[
{
"company": "_Test Company",
"doctype": "Stock Entry",
"stock_entry_type": "Material Receipt",
"purpose": "Material Receipt",
"items": [
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Stock Entry Detail",
"expense_account": "Stock Adjustment - _TC",
"basic_rate": 100,
"item_code": "_Test Item",
"parentfield": "items",
"qty": 50.0,
"stock_uom": "_Test UOM",
"t_warehouse": "_Test Warehouse - _TC",
"transfer_qty": 50.0,
"uom": "_Test UOM"
}
]
},
{
"company": "_Test Company",
"doctype": "Stock Entry",
"purpose": "Material Issue",
"stock_entry_type": "Material Issue",
"items": [
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Stock Entry Detail",
"expense_account": "Stock Adjustment - _TC",
"basic_rate": 100,
"item_code": "_Test Item",
"parentfield": "items",
"qty": 40.0,
"s_warehouse": "_Test Warehouse - _TC",
"stock_uom": "_Test UOM",
"transfer_qty": 40.0,
"uom": "_Test UOM"
}
]
},
{
"company": "_Test Company",
"doctype": "Stock Entry",
"purpose": "Material Transfer",
"stock_entry_type": "Material Transfer",
"items": [
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Stock Entry Detail",
"expense_account": "Stock Adjustment - _TC",
"basic_rate": 100,
"item_code": "_Test Item",
"parentfield": "items",
"qty": 45.0,
"s_warehouse": "_Test Warehouse - _TC",
"stock_uom": "_Test UOM",
"t_warehouse": "_Test Warehouse 1 - _TC",
"transfer_qty": 45.0,
"uom": "_Test UOM"
}
]
},
{
"company": "_Test Company",
"doctype": "Stock Entry",
"purpose": "Repack",
"stock_entry_type": "Repack",
"items": [
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Stock Entry Detail",
"expense_account": "Stock Adjustment - _TC",
"basic_rate": 100,
"item_code": "_Test Item",
"parentfield": "items",
"qty": 50.0,
"s_warehouse": "_Test Warehouse - _TC",
"stock_uom": "_Test UOM",
"transfer_qty": 50.0,
"uom": "_Test UOM"
},
{
"conversion_factor": 1.0,
"cost_center": "_Test Cost Center - _TC",
"doctype": "Stock Entry Detail",
"expense_account": "Stock Adjustment - _TC",
"basic_rate": 5000,
"item_code": "_Test Item Home Desktop 100",
"parentfield": "items",
"qty": 1,
"stock_uom": "_Test UOM",
"t_warehouse": "_Test Warehouse - _TC",
"transfer_qty": 1,
"uom": "_Test UOM"
}
]
}
]