diff options
| author | Julien Castiaux <juc@odoo.com> | 2019-08-29 12:21:54 +0000 |
|---|---|---|
| committer | Julien Castiaux <juc@odoo.com> | 2019-08-29 12:21:54 +0000 |
| commit | 33354f71e16e595b8f9f2039abce82cd2e80097f (patch) | |
| tree | 22d80ef8c13b24ff6f8e218a6cfb17e161f8b440 | |
| parent | 135079044c79cbcbd69b5eb492fb366747ba03da (diff) | |
[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) <moc@odoo.com>
| -rw-r--r-- | addons/payment_paypal/models/payment.py | 2 | ||||
| -rw-r--r-- | 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', |
