mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-22 10:22:04 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
|
|
@ -0,0 +1,34 @@
|
|||
from requests import Response
|
||||
from unittest.mock import patch
|
||||
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
|
||||
from odoo.tests.common import tagged
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
class TestAdyenPoS(TestPointOfSaleHttpCommon):
|
||||
def test_adyen_basic_order(self):
|
||||
self.main_pos_config.write({
|
||||
"payment_method_ids": [
|
||||
(0, 0, {
|
||||
"name": "Adyen",
|
||||
"use_payment_terminal": True,
|
||||
"adyen_api_key": "my_adyen_api_key",
|
||||
"adyen_terminal_identifier": "my_adyen_terminal",
|
||||
"adyen_test_mode": False,
|
||||
"use_payment_terminal": "adyen",
|
||||
"payment_method_type": "terminal",
|
||||
'journal_id': self.bank_journal.id,
|
||||
}),
|
||||
],
|
||||
})
|
||||
self.main_pos_config.with_user(self.pos_user).open_ui()
|
||||
|
||||
def post(url, **kwargs):
|
||||
# TODO: check that the data passed by pos to adyen is correct
|
||||
response = Response()
|
||||
response.status_code = 200
|
||||
response._content = "ok".encode()
|
||||
return response
|
||||
|
||||
with patch('odoo.addons.pos_adyen.models.pos_payment_method.requests.post', post), \
|
||||
patch('odoo.addons.pos_adyen.controllers.main.consteq', lambda a,b: True):
|
||||
self.start_pos_tour('PosAdyenTour')
|
||||
Loading…
Add table
Add a link
Reference in a new issue