From de8c3ba968ce239db3a1e317254aa77852628dcc Mon Sep 17 00:00:00 2001 From: ljain112 Date: Sat, 12 Jul 2025 12:48:01 +0530 Subject: [PATCH] chore: fix flacky test and remove redundant code --- erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py | 7 ------- erpnext/stock/doctype/batch/test_batch.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py index b9c479b012c..a1282f07717 100644 --- a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py @@ -1133,13 +1133,6 @@ def create_pos_invoice(**args): return pos_inv -def make_batch_item(item_name): - from erpnext.stock.doctype.item.test_item import make_item - - if not frappe.db.exists(item_name): - return make_item(item_name, dict(has_batch_no=1, create_new_batch=1, is_stock_item=1)) - - def set_allow_partial_payment(pos_profile, value): pos_profile.reload() pos_profile.allow_partial_payment = value diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py index d48ad47b100..cde02151dea 100644 --- a/erpnext/stock/doctype/batch/test_batch.py +++ b/erpnext/stock/doctype/batch/test_batch.py @@ -35,7 +35,7 @@ class TestBatch(IntegrationTestCase): def make_batch_item(cls, item_name=None): from erpnext.stock.doctype.item.test_item import make_item - if not frappe.db.exists(item_name): + if not frappe.db.exists("Item", item_name): return make_item(item_name, dict(has_batch_no=1, create_new_batch=1, is_stock_item=1)) def test_purchase_receipt(self, batch_qty=100):