mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
refactor(test): flaky post invoice test
This commit is contained in:
@@ -1002,9 +1002,10 @@ class TestPOSInvoice(ERPNextTestSuite):
|
|||||||
se.cancel()
|
se.cancel()
|
||||||
|
|
||||||
def test_ignore_pricing_rule(self):
|
def test_ignore_pricing_rule(self):
|
||||||
|
frappe.set_user("Administrator")
|
||||||
from erpnext.accounts.doctype.pricing_rule.test_pricing_rule import make_pricing_rule
|
from erpnext.accounts.doctype.pricing_rule.test_pricing_rule import make_pricing_rule
|
||||||
|
|
||||||
item_price = frappe.get_doc(
|
item_price = self.truncate_make_item_price(
|
||||||
{
|
{
|
||||||
"doctype": "Item Price",
|
"doctype": "Item Price",
|
||||||
"item_code": "_Test Item",
|
"item_code": "_Test Item",
|
||||||
@@ -1012,7 +1013,7 @@ class TestPOSInvoice(ERPNextTestSuite):
|
|||||||
"price_list_rate": "450",
|
"price_list_rate": "450",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
item_price.insert()
|
|
||||||
pr = make_pricing_rule(selling=1, priority=5, discount_percentage=10)
|
pr = make_pricing_rule(selling=1, priority=5, discount_percentage=10)
|
||||||
pr.save()
|
pr.save()
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,13 @@ class ERPNextTestSuite(unittest.TestCase):
|
|||||||
records = load_test_records_for(doctype)
|
records = load_test_records_for(doctype)
|
||||||
cls.globalTestRecords[doctype] = records[doctype]
|
cls.globalTestRecords[doctype] = records[doctype]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def truncate_make_item_price(cls, record):
|
||||||
|
frappe.db.truncate("Item Price")
|
||||||
|
item_price = frappe.get_doc(record)
|
||||||
|
item_price.insert()
|
||||||
|
return item_price
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def make_presets(cls):
|
def make_presets(cls):
|
||||||
from frappe.desk.page.setup_wizard.install_fixtures import update_genders, update_salutations
|
from frappe.desk.page.setup_wizard.install_fixtures import update_genders, update_salutations
|
||||||
|
|||||||
Reference in New Issue
Block a user