The name "Payment Acquirer Test" of the acquirer bundled with the module `payment_test` is confusing. It is actually the only acquirer that doesn't connect to a test API, and its purpose is not to make test transactions but to showcase the integration of other apps (Accounting, Sales, eCommerce, Subscriptions) with demo payments. Hence, the module is renamed to `payment_demo` along with its data and technical keys to better make the distinction between acquirers' test environment and demo payments. task-2853481 closes odoo/odoo#99397 Related: odoo/upgrade#3846 Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from unittest.mock import patch
|
|
|
|
from odoo.tests import tagged
|
|
|
|
from odoo.addons.payment_demo.controllers.main import PaymentDemoController
|
|
from odoo.addons.payment_demo.tests.common import PaymentDemoCommon
|
|
from odoo.addons.payment.tests.http_common import PaymentHttpCommon
|
|
|
|
|
|
@tagged('-at_install', 'post_install')
|
|
class TestProcessingFlows(PaymentDemoCommon, PaymentHttpCommon):
|
|
|
|
def test_portal_payment_triggers_processing(self):
|
|
""" Test that paying from the frontend triggers the processing of the notification data. """
|
|
self._create_transaction(flow='direct')
|
|
url = self._build_url(PaymentDemoController._simulation_url)
|
|
with patch(
|
|
'odoo.addons.payment.models.payment_transaction.PaymentTransaction'
|
|
'._handle_notification_data'
|
|
) as handle_notification_data_mock:
|
|
self._make_json_rpc_request(url, data=self.notification_data)
|
|
self.assertEqual(handle_notification_data_mock.call_count, 1)
|