test: refactor test case
This commit is contained in:
parent
d193a14b8f
commit
71aa8c5e1c
@ -33,10 +33,8 @@ class TestQuotation(FrappeTestCase):
|
|||||||
def test_maintain_rate_in_sales_cycle_is_enforced(self):
|
def test_maintain_rate_in_sales_cycle_is_enforced(self):
|
||||||
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
||||||
|
|
||||||
maintain_rate = frappe.db.get_value(
|
maintain_rate = frappe.db.get_single_value("Selling Settings", "maintain_same_sales_rate")
|
||||||
"Selling Settings", "Selling Settings", "maintain_same_sales_rate"
|
frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", 1)
|
||||||
)
|
|
||||||
frappe.db.set_value("Selling Settings", "Selling Settings", "maintain_same_sales_rate", 1)
|
|
||||||
|
|
||||||
quotation = frappe.copy_doc(test_records[0])
|
quotation = frappe.copy_doc(test_records[0])
|
||||||
quotation.transaction_date = nowdate()
|
quotation.transaction_date = nowdate()
|
||||||
@ -48,9 +46,7 @@ class TestQuotation(FrappeTestCase):
|
|||||||
sales_order.items[0].rate = 1
|
sales_order.items[0].rate = 1
|
||||||
self.assertRaises(frappe.ValidationError, sales_order.save)
|
self.assertRaises(frappe.ValidationError, sales_order.save)
|
||||||
|
|
||||||
frappe.db.set_value(
|
frappe.db.set_single_value("Selling Settings", "maintain_same_sales_rate", maintain_rate)
|
||||||
"Selling Settings", "Selling Settings", "maintain_same_sales_rate", maintain_rate
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_make_sales_order_with_different_currency(self):
|
def test_make_sales_order_with_different_currency(self):
|
||||||
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
from erpnext.selling.doctype.quotation.quotation import make_sales_order
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user