Merge pull request #48550 from ljain112/fix-test-batch

chore: fix flacky test and remove redundant code
This commit is contained in:
rohitwaghchaure
2025-07-13 17:20:39 +05:30
committed by GitHub
2 changed files with 3 additions and 8 deletions

View File

@@ -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

View File

@@ -35,9 +35,11 @@ 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))
return frappe.get_doc("Item", item_name)
def test_purchase_receipt(self, batch_qty=100):
"""Test automated batch creation from Purchase Receipt"""
self.make_batch_item("ITEM-BATCH-1")