From 33354f71e16e595b8f9f2039abce82cd2e80097f Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Thu, 29 Aug 2019 12:21:54 +0000 Subject: [PATCH] [FIX] payment_paypal: external tests All dates in the backend must be naive (=in utc, without timezone) closes odoo/odoo#36230 Signed-off-by: Christophe Monniez (moc) --- addons/payment_paypal/models/payment.py | 2 +- addons/payment_paypal/tests/test_paypal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment_paypal/models/payment.py b/addons/payment_paypal/models/payment.py index 9485ec1fabd..78b9d6032dd 100644 --- a/addons/payment_paypal/models/payment.py +++ b/addons/payment_paypal/models/payment.py @@ -211,7 +211,7 @@ class TxPaypal(models.Model): 'PST': -8 * 3600, 'PDT': -7 * 3600, } - date = dateutil.parser.parse(data.get('payment_date'), tzinfos=tzinfos).astimezone(pytz.utc) + date = dateutil.parser.parse(data.get('payment_date'), tzinfos=tzinfos).astimezone(pytz.utc).replace(tzinfo=None) except: date = fields.Datetime.now() res.update(date=date) diff --git a/addons/payment_paypal/tests/test_paypal.py b/addons/payment_paypal/tests/test_paypal.py index 532d14f54ba..044226b24d9 100644 --- a/addons/payment_paypal/tests/test_paypal.py +++ b/addons/payment_paypal/tests/test_paypal.py @@ -131,7 +131,7 @@ class PaypalForm(PaypalCommon): 'protection_eligibility': u'Ineligible', 'last_name': u'Poilu', 'txn_id': u'08D73520KX778924N', - 'receiver_email': self.env.user.email, + 'receiver_email': 'dummy', 'payment_status': u'Pending', 'payment_gross': u'', 'tax': u'0.00',