mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 10:41:21 +00:00
refactor(test): load shipping rule records
This commit is contained in:
108
erpnext/accounts/doctype/shipping_rule/test_records.json
Normal file
108
erpnext/accounts/doctype/shipping_rule/test_records.json
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"account": "_Test Account Shipping Charges - _TC",
|
||||||
|
"calculate_based_on": "Net Total",
|
||||||
|
"company": "_Test Company",
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"doctype": "Shipping Rule",
|
||||||
|
"label": "_Test Shipping Rule",
|
||||||
|
"name": "_Test Shipping Rule",
|
||||||
|
"shipping_rule_type": "Selling",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 0,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 50.0,
|
||||||
|
"to_value": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 101,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 100.0,
|
||||||
|
"to_value": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 201,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 200.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"countries": [
|
||||||
|
{"country": "India"}
|
||||||
|
],
|
||||||
|
"worldwide_shipping": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account": "_Test Account Shipping Charges - _TC",
|
||||||
|
"calculate_based_on": "Net Total",
|
||||||
|
"company": "_Test Company",
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"doctype": "Shipping Rule",
|
||||||
|
"label": "_Test Shipping Rule - India",
|
||||||
|
"name": "_Test Shipping Rule - India",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 0,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 50.0,
|
||||||
|
"to_value": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 101,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 100.0,
|
||||||
|
"to_value": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 201,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 0.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"countries": [
|
||||||
|
{"country": "India"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account": "_Test Account Shipping Charges - _TC",
|
||||||
|
"calculate_based_on": "Net Total",
|
||||||
|
"company": "_Test Company",
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"doctype": "Shipping Rule",
|
||||||
|
"label": "_Test Shipping Rule - Rest of the World",
|
||||||
|
"name": "_Test Shipping Rule - Rest of the World",
|
||||||
|
"shipping_rule_type": "Buying",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 0,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 500.0,
|
||||||
|
"to_value": 1000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 1001,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 1000.0,
|
||||||
|
"to_value": 2000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Shipping Rule Condition",
|
||||||
|
"from_value": 2001,
|
||||||
|
"parentfield": "conditions",
|
||||||
|
"shipping_amount": 1500.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"worldwide_shipping": 1,
|
||||||
|
"countries": [
|
||||||
|
{"country": "Germany"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -13,6 +13,9 @@ from erpnext.tests.utils import ERPNextTestSuite
|
|||||||
|
|
||||||
|
|
||||||
class TestShippingRule(ERPNextTestSuite):
|
class TestShippingRule(ERPNextTestSuite):
|
||||||
|
def setUp(self):
|
||||||
|
self.load_test_records("Shipping Rule")
|
||||||
|
|
||||||
def test_from_greater_than_to(self):
|
def test_from_greater_than_to(self):
|
||||||
shipping_rule = frappe.copy_doc(self.globalTestRecords["Shipping Rule"][0])
|
shipping_rule = frappe.copy_doc(self.globalTestRecords["Shipping Rule"][0])
|
||||||
shipping_rule.name = self.globalTestRecords["Shipping Rule"][0].get("name")
|
shipping_rule.name = self.globalTestRecords["Shipping Rule"][0].get("name")
|
||||||
|
|||||||
Reference in New Issue
Block a user