File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# See license.txt
33
44import unittest
5+ from unittest import mock
56
67import frappe
78
@@ -63,9 +64,20 @@ def setUp(self):
6364 ).insert (ignore_permissions = True )
6465 register_payment_terminal_provider (_SimulatedPaymentTerminalProvider ())
6566
67+ # The transaction log's `invoice` field link-validates against a real
68+ # POS Invoice, which is correct for production (a terminal
69+ # transaction is always tied to a real invoice) but out of scope to
70+ # fixture up here -- these tests only cover the terminal/transaction
71+ # lifecycle itself, not invoice creation. Skip link validation for
72+ # the duration of this test class rather than either weakening the
73+ # field in production or dragging in an unrelated invoice fixture.
74+ self ._link_patch = mock .patch ("frappe.model.document.Document._validate_links" )
75+ self ._link_patch .start ()
76+
6677 def tearDown (self ):
6778 from ury .ury .api import payment_terminal
6879
80+ self ._link_patch .stop ()
6981 payment_terminal ._payment_terminal_provider = payment_terminal ._NoOpPaymentTerminalProvider ()
7082 frappe .db .delete (
7183 "URY Payment Terminal Transaction" , {"terminal" : self .terminal .name }
You can’t perform that action at this time.
0 commit comments