mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
refactor(test): make item price deterministic
This commit is contained in:
@@ -11,10 +11,10 @@ from erpnext.tests.utils import ERPNextTestSuite
|
|||||||
|
|
||||||
|
|
||||||
class TestItemPrice(ERPNextTestSuite):
|
class TestItemPrice(ERPNextTestSuite):
|
||||||
def setUp(self):
|
@classmethod
|
||||||
super().setUp()
|
def setUpClass(cls):
|
||||||
frappe.db.sql("delete from `tabItem Price`")
|
super().setUpClass()
|
||||||
make_test_records_for_doctype("Item Price", force=True)
|
cls.load_test_records("Item Price")
|
||||||
|
|
||||||
def test_template_item_price(self):
|
def test_template_item_price(self):
|
||||||
from erpnext.stock.doctype.item.test_item import make_item
|
from erpnext.stock.doctype.item.test_item import make_item
|
||||||
|
|||||||
56
erpnext/stock/doctype/item_price/test_records.json
Normal file
56
erpnext/stock/doctype/item_price/test_records.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item",
|
||||||
|
"price_list": "_Test Price List",
|
||||||
|
"price_list_rate": 100,
|
||||||
|
"valid_from": "2017-04-18",
|
||||||
|
"valid_upto": "2017-04-26"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item",
|
||||||
|
"price_list": "_Test Price List Rest of the World",
|
||||||
|
"price_list_rate": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item 2",
|
||||||
|
"price_list": "_Test Price List Rest of the World",
|
||||||
|
"price_list_rate": 20,
|
||||||
|
"valid_from": "2017-04-18",
|
||||||
|
"valid_upto": "2017-04-26",
|
||||||
|
"customer": "_Test Customer",
|
||||||
|
"uom": "_Test UOM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item Home Desktop 100",
|
||||||
|
"price_list": "_Test Price List",
|
||||||
|
"price_list_rate": 1000,
|
||||||
|
"valid_from": "2017-04-10",
|
||||||
|
"valid_upto": "2017-04-17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item Home Desktop Manufactured",
|
||||||
|
"price_list": "_Test Price List",
|
||||||
|
"price_list_rate": 1000,
|
||||||
|
"valid_from": "2017-04-10",
|
||||||
|
"valid_upto": "2017-04-17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item",
|
||||||
|
"price_list": "_Test Buying Price List",
|
||||||
|
"price_list_rate": 100,
|
||||||
|
"supplier": "_Test Supplier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Item Price",
|
||||||
|
"item_code": "_Test Item",
|
||||||
|
"price_list": "_Test Selling Price List",
|
||||||
|
"price_list_rate": 200,
|
||||||
|
"customer": "_Test Customer"
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user