Commit d3d302b2 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_payzen_secure_payment: Start to test for CodingStyle

parent 18614ea8
...@@ -12,7 +12,7 @@ else: ...@@ -12,7 +12,7 @@ else:
import datetime import datetime
import os import os
import time import time
import six
import requests import requests
from Products.ERP5Type.Core.Workflow import ValidationFailed from Products.ERP5Type.Core.Workflow import ValidationFailed
from Products.ERP5Type.Utils import str2bytes, bytes2str from Products.ERP5Type.Utils import str2bytes, bytes2str
...@@ -24,20 +24,21 @@ if 'TZ' in os.environ: ...@@ -24,20 +24,21 @@ if 'TZ' in os.environ:
tz = os.environ['TZ'] tz = os.environ['TZ']
os.environ['TZ'] = 'UTC' os.environ['TZ'] = 'UTC'
time.tzset() time.tzset()
def setUTCTimeZone(fn): def setUTCTimeZone(fn):
def wrapped(*args, **kwargs): def wrapped(*args, **kwargs):
present = False tz_present = False
tz = None environ_tz = None
if 'TZ' in os.environ: if 'TZ' in os.environ:
present = True tz_present = True
tz = os.environ['TZ'] environ_tz = os.environ['TZ']
os.environ['TZ'] = 'UTC' os.environ['TZ'] = 'UTC'
time.tzset() time.tzset()
try: try:
return fn(*args, **kwargs) return fn(*args, **kwargs)
finally: finally:
if present: if tz_present:
os.environ['TZ'] = tz os.environ['TZ'] = environ_tz
else: else:
del(os.environ['TZ']) del(os.environ['TZ'])
time.tzset() time.tzset()
...@@ -189,14 +190,14 @@ class PayzenService(XMLObject, PayzenREST): ...@@ -189,14 +190,14 @@ class PayzenService(XMLObject, PayzenREST):
def notifySuccess(self, REQUEST=None, **kw): def notifySuccess(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation""" """See Payment Service Interface Documentation"""
raise NotImplementedError raise NotImplementedError
return self._getTypeBasedMethod("acceptPayment")(**kw) # return self._getTypeBasedMethod("acceptPayment")(**kw)
def notifyFail(self, REQUEST=None, **kw): def notifyFail(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation""" """See Payment Service Interface Documentation"""
raise NotImplementedError raise NotImplementedError
return self._getTypeBasedMethod("failInPayment")(**kw) # return self._getTypeBasedMethod("failInPayment")(**kw)
def notifyCancel(self, REQUEST=None, **kw): def notifyCancel(self, REQUEST=None, **kw):
"""See Payment Service Interface Documentation""" """See Payment Service Interface Documentation"""
raise NotImplementedError raise NotImplementedError
return self._getTypeBasedMethod("abortPayment")(**kw) # return self._getTypeBasedMethod("abortPayment")(**kw)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment