From bfe4567a3be065a3bb37c0709a5879e56636fd3c Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Wed, 6 Jan 2021 10:03:24 -0300 Subject: [PATCH] [FIX] payment_cielo tests --- payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml | 4 ++-- payment_cielo/tests/test_cielo.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml b/payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml index 0b098ad92112..1fcdda766fc9 100644 --- a/payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml +++ b/payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml @@ -59,7 +59,7 @@ interactions: - request: body: '{"MerchantOrderId": "37", "Customer": {"Name": "Norbert Buyer"}, "Payment": {"Type": "CreditCard", "Amount": 11500.0, "Installments": 1, "SoftDescriptor": - "test_ref_2020", "CreditCard": {"CardToken": "905ffdbd-ddc1-49f5-b9b8-9e512ba9917e", + "test_ref_10_c", "CreditCard": {"CardToken": "905ffdbd-ddc1-49f5-b9b8-9e512ba9917e", "Brand": "visa", "SaveCard": "true"}}}' headers: Accept: @@ -82,7 +82,7 @@ interactions: uri: https://apisandbox.cieloecommerce.cielo.com.br/1/sales response: body: - string: '{"MerchantOrderId":"37","Customer":{"Name":"Norbert Buyer"},"Payment":{"ServiceTaxAmount":0,"Installments":1,"Interest":0,"Capture":false,"Authenticate":false,"Recurrent":false,"CreditCard":{"SaveCard":true,"CardToken":"905ffdbd-ddc1-49f5-b9b8-9e512ba9917e","Brand":"Visa"},"Tid":"1124020251914","ProofOfSale":"170380","AuthorizationCode":"189477","SoftDescriptor":"test_ref_2020","Provider":"Simulado","IsQrCode":false,"Amount":11500,"ReceivedDate":"2020-11-24 + string: '{"MerchantOrderId":"37","Customer":{"Name":"Norbert Buyer"},"Payment":{"ServiceTaxAmount":0,"Installments":1,"Interest":0,"Capture":false,"Authenticate":false,"Recurrent":false,"CreditCard":{"SaveCard":true,"CardToken":"905ffdbd-ddc1-49f5-b9b8-9e512ba9917e","Brand":"Visa"},"Tid":"1124020251914","ProofOfSale":"170380","AuthorizationCode":"189477","SoftDescriptor":"test_ref_10_c","Provider":"Simulado","IsQrCode":false,"Amount":11500,"ReceivedDate":"2020-11-24 14:02:51","Status":1,"IsSplitted":false,"ReturnMessage":"Operation Successful","ReturnCode":"4","PaymentId":"42e731d0-8cef-4716-921e-62991244b788","Type":"CreditCard","Currency":"BRL","Country":"BRA","Links":[{"Method":"GET","Rel":"self","Href":"https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788"},{"Method":"PUT","Rel":"capture","Href":"https://apisandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788/capture"},{"Method":"PUT","Rel":"void","Href":"https://apisandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788/void"}]}}' headers: Access-Control-Expose-Headers: diff --git a/payment_cielo/tests/test_cielo.py b/payment_cielo/tests/test_cielo.py index 607cbcdecda8..5908c27bac28 100644 --- a/payment_cielo/tests/test_cielo.py +++ b/payment_cielo/tests/test_cielo.py @@ -2,7 +2,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import odoo -from odoo import fields from odoo.addons.payment.tests.common import PaymentAcquirerCommon import time import logging @@ -56,7 +55,7 @@ def test_10_cielo_s2s(self): time.sleep(2) # Create transaction tx = self.env['payment.transaction'].create({ - 'reference': 'test_ref_%s' % fields.date.today(), + 'reference': 'test_ref_10_c', 'currency_id': self.currency_euro.id, 'acquirer_id': self.cielo.id, 'partner_id': self.buyer_id, @@ -105,7 +104,7 @@ def test_20_cielo_s2s(self): # Create transaction todo test tx = self.env['payment.transaction'].create({ - 'reference': 'test_ref_%s' % fields.date.today(), + 'reference': 'test_ref_10_c', 'currency_id': self.currency_euro.id, 'acquirer_id': self.cielo.id, 'partner_id': self.buyer_id,