From a8cd850bb6a9f4136728298dabc6501387ad6de3 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 3 Apr 2024 02:23:17 +0200 Subject: [PATCH] test: patch payments app interface --- erpnext/selling/doctype/sales_order/test_sales_order.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 0f3284729578..09fa853d378c 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -2,6 +2,7 @@ # License: GNU General Public License v3. See license.txt import json +from unittest.mock import patch import frappe import frappe.permissions @@ -1956,7 +1957,12 @@ def test_expired_rate_for_packed_item(self): self.assertEqual(so.items[0].rate, scenario.get("expected_rate")) self.assertEqual(so.packed_items[0].rate, scenario.get("expected_rate")) - def test_sales_order_advance_payment_status(self): + @patch( + # this also shadows one (1) call to _get_payment_gateway_controller + "erpnext.accounts.doctype.payment_request.payment_request.PaymentRequest.get_payment_url", + return_value=None, + ) + def test_sales_order_advance_payment_status(self, mocked_get_payment_url): from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request