diff --git a/make_post_sell/tests/test_invoice_deletion.py b/make_post_sell/tests/test_invoice_deletion.py index add6f23..b8b2a46 100644 --- a/make_post_sell/tests/test_invoice_deletion.py +++ b/make_post_sell/tests/test_invoice_deletion.py @@ -162,7 +162,7 @@ class TestInvoiceDeletion(unittest.TestCase): self.mock_dbsession.add.assert_not_called() @patch("make_post_sell.lib.crypto_watcher.delete_invoice_by_id") - @patch("make_post_sell.lib.crypto_watcher.logger") + @patch("make_post_sell.lib.crypto_watcher.log") def test_handle_invoice_deletion_failure(self, mock_logger, mock_delete_invoice): """Test that invoice deletion failures are handled gracefully.""" mock_delete_invoice.side_effect = Exception("Database error") @@ -172,8 +172,8 @@ class TestInvoiceDeletion(unittest.TestCase): # Should not raise exception delete_invoice_for_terminal_state(self.mock_dbsession, self.mock_crypto_payment) - # Verify error was logged - mock_logger.error.assert_called_once() + # Verify error was logged using centralized error_with_context method + mock_logger.error_with_context.assert_called_once() # Verify invoice reference was NOT cleared since deletion failed self.assertEqual(self.mock_crypto_payment.invoice_id, "test-invoice-123")