mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
refactor(test): make material request deterministic
This commit is contained in:
@@ -24,6 +24,11 @@ from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestMaterialRequest(ERPNextTestSuite):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.load_test_records("Material Request")
|
||||
|
||||
def test_material_request_qty(self):
|
||||
mr = frappe.copy_doc(self.globalTestRecords["Material Request"][0])
|
||||
mr.items[0].qty = 0
|
||||
|
||||
57
erpnext/stock/doctype/material_request/test_records.json
Normal file
57
erpnext/stock/doctype/material_request/test_records.json
Normal file
@@ -0,0 +1,57 @@
|
||||
[
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Material Request",
|
||||
"fiscal_year": "_Test Fiscal Year 2013",
|
||||
"items": [
|
||||
{
|
||||
"description": "_Test Item Home Desktop 100",
|
||||
"doctype": "Material Request Item",
|
||||
"item_code": "_Test Item Home Desktop 100",
|
||||
"item_name": "_Test Item Home Desktop 100",
|
||||
"parentfield": "items",
|
||||
"qty": 54.0,
|
||||
"schedule_date": "2013-02-18",
|
||||
"uom": "_Test UOM 1",
|
||||
"warehouse": "_Test Warehouse - _TC"
|
||||
},
|
||||
{
|
||||
"description": "_Test Item Home Desktop 200",
|
||||
"doctype": "Material Request Item",
|
||||
"item_code": "_Test Item Home Desktop 200",
|
||||
"item_name": "_Test Item Home Desktop 200",
|
||||
"parentfield": "items",
|
||||
"qty": 3.0,
|
||||
"schedule_date": "2013-02-19",
|
||||
"uom": "_Test UOM 1",
|
||||
"warehouse": "_Test Warehouse - _TC"
|
||||
}
|
||||
],
|
||||
"material_request_type": "Purchase",
|
||||
"naming_series": "_T-Material Request-",
|
||||
"transaction_date": "2013-02-18",
|
||||
"schedule_date": "2013-02-19"
|
||||
},
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Material Request",
|
||||
"fiscal_year": "_Test Fiscal Year 2013",
|
||||
"items": [
|
||||
{
|
||||
"description": "_Test FG Item",
|
||||
"doctype": "Material Request Item",
|
||||
"item_code": "_Test FG Item",
|
||||
"item_name": "_Test FG Item",
|
||||
"parentfield": "items",
|
||||
"qty": 5,
|
||||
"schedule_date": "2013-02-19",
|
||||
"uom": "_Test UOM 1",
|
||||
"warehouse": "_Test Warehouse - _TC"
|
||||
}
|
||||
],
|
||||
"material_request_type": "Manufacture",
|
||||
"naming_series": "_T-Material Request-",
|
||||
"transaction_date": "2013-02-18",
|
||||
"schedule_date": "2013-02-19"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user