mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-01 15:47:06 +00:00
fix: restore isolated loyalty and subcontracting tests (#58587)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user