fix: restore isolated loyalty and subcontracting tests (#58587)

This commit is contained in:
Mihir Kandoi
2026-08-31 13:40:14 +05:30
committed by GitHub
parent 4355f8e60e
commit 6cca7d670b
3 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from unittest.mock import patch
import frappe
from frappe.query_builder.functions import Sum
@@ -196,7 +196,7 @@ class TestLoyaltyProgram(ERPNextTestSuite):
for d in company_wise_info:
self.assertTrue(d.get("loyalty_points"))
@unittest.mock.patch("erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_details")
@patch("erpnext.accounts.doctype.loyalty_program.loyalty_program.get_loyalty_details")
def test_tier_selection(self, mock_get_loyalty_details):
# Create a new loyalty program with multiple tiers
loyalty_program = frappe.get_doc(

View File

@@ -597,6 +597,8 @@ class ManufactureStockEntry(BaseManufactureStockEntry):
self.doc.append("items", item_args)
def _resolve_rm_warehouse(self, row):
if self.wo_doc and self.wo_doc.skip_transfer and not self.wo_doc.from_wip_warehouse:
return row.get("source_warehouse")
if self.doc.from_warehouse:
return self.doc.from_warehouse
if self.wo_doc and self.wo_doc.from_wip_warehouse:

View File

@@ -169,6 +169,10 @@ class IntegrationTestSubcontractingInwardOrder(ERPNextTestSuite):
wo.submit()
manufacture = frappe.new_doc("Stock Entry").update(make_stock_entry_from_wo(wo.name, "Manufacture"))
self.assertEqual(
next(item.s_warehouse for item in manufacture.items if item.item_code == "Self RM"),
"Stores - _TC",
)
manufacture.save()
frappe.new_doc(
"Stock Entry Detail",