Commit 7f1a4034 authored by Julien Muchembled's avatar Julien Muchembled

Drop support for Python < 2.7

parent c70989a5
......@@ -28,7 +28,7 @@
from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \
TestLiveConfiguratorWorkflowMixin
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from unittest import expectedFailure
class TestMaxmaDemoConfiguratorWorkflow(TestLiveConfiguratorWorkflowMixin):
"""
......
......@@ -29,9 +29,9 @@
import os
from unittest import expectedFailure
from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.runUnitTest import tests_home
from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Configurator.tests.ConfiguratorTestMixin import \
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.collections import OrderedDict\n
<value> <string>from collections import OrderedDict\n
from json import dumps\n
label_list = context.getLabelValueList()\n
num = len(label_list)\n
......
......@@ -28,10 +28,10 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import unittest
from unittest import expectedFailure
from zLOG import LOG
from Testing import ZopeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestOxatisSynchronization(ERP5TypeTestCase):
"""
......
......@@ -28,11 +28,11 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import unittest
from unittest import expectedFailure
from zLOG import LOG
from Testing import ZopeTestCase
from AccessControl.SecurityManagement import newSecurityManager
import os
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestUbercartSynchronization(ERP5TypeTestCase):
"""
......
......@@ -28,13 +28,12 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import unittest
from unittest import expectedFailure
from zLOG import LOG
from Testing import ZopeTestCase
from AccessControl.SecurityManagement import newSecurityManager
import os
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestVirtuemartSynchronization(ERP5TypeTestCase):
"""
"""
......
......@@ -30,9 +30,9 @@
import httplib
import urlparse
from unittest import expectedFailure
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.test.ShaCacheMixin import ShaCacheMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
"""
......
......@@ -32,9 +32,9 @@ import httplib
import urlparse
import json
import random
from unittest import expectedFailure
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.test.ShaDirMixin import ShaDirMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
"""
......
......@@ -30,11 +30,11 @@
import base64
import httplib
from unittest import expectedFailure
from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.test.ShaCacheMixin import ShaCacheMixin
from erp5.component.test.ShaSecurityMixin import ShaSecurityMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeTestCase):
"""
......
......@@ -382,10 +382,7 @@ class ServerProxy(xmlrpclib.ServerProxy):
transport = self.__transport
def make_connection(*args, **kw):
conn = transport.__class__.make_connection(transport, *args, **kw)
# BBB: On Python < 2.7, HTTP connection is wrapped
c = getattr(conn, '_conn', conn)
assert hasattr(c, 'timeout')
c.timeout = 120
conn.timeout = 120
return conn
transport.make_connection = make_connection
self.__rpc_lock = threading.Lock()
......
......@@ -30,7 +30,6 @@ import inspect
import unittest
from Products.ERP5Type.tests.utils import LogInterceptor
from Products.ERP5Type.tests.backportUnittest import skip
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
......
......@@ -35,9 +35,9 @@ from Products.ERP5Type.Core.Predicate import Predicate
from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.mixin.equivalence_tester import EquivalenceTesterMixin
ROUNDING_OPTION_DICT = dict((name, value)
for name, value in decimal.__dict__.items()
if name.startswith('ROUND_'))
ROUNDING_OPTION_DICT = {name: value
for name, value in decimal.__dict__.items()
if name.startswith('ROUND_')}
# XXX: We could compute a value based on sys.float_info.epsilon
DEFAULT_PRECISION = 1e-12
......
......@@ -31,7 +31,6 @@
import unittest
import time
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.Formulator.Errors import ValidationError
from Products.ERP5Type.Document import newTempBase
from DateTime import DateTime
......
......@@ -31,7 +31,6 @@
import unittest
import time
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from DateTime import DateTime
class TestAuoLogout(ERP5TypeTestCase):
......
......@@ -30,7 +30,7 @@
import unittest
import os
from unittest import skip
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase,\
......@@ -41,7 +41,6 @@ from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import convertToUpperCase
from zExceptions import BadRequest
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.Workflow import addWorkflowByType
from Products.CMFCore.WorkflowCore import WorkflowException
......
......@@ -29,6 +29,7 @@
import unittest
import logging
from unittest import expectedFailure, skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Acquisition import aq_base
......@@ -40,7 +41,6 @@ from Products.ERP5Type.Globals import PersistentMapping
from Products.CMFCore.Expression import Expression
from Products.ERP5Type.tests.utils import LogInterceptor
from Products.ERP5Type.Workflow import addWorkflowByType
from Products.ERP5Type.tests.backportUnittest import expectedFailure, skip
from Products.ERP5VCS.WorkingCopy import getVcsTool
import shutil
import os
......
......@@ -29,6 +29,7 @@
import unittest
import os
import textwrap
from unittest import expectedFailure
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.ERP5Type.tests.utils import FileUpload
......@@ -36,7 +37,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase,\
_getConversionServerDict
from Products.ERP5OOo.tests.testIngestion import FILENAME_REGULAR_EXPRESSION
from Products.ERP5OOo.tests.testIngestion import REFERENCE_REGULAR_EXPRESSION
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from email.header import decode_header
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
......
......@@ -26,12 +26,13 @@
#
##############################################################################
import unittest
from unittest import skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5ReportTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList
from DateTime import DateTime
from Products.ERP5Type.tests.backportUnittest import skip
class TestCalendar(ERP5ReportTestCase):
......@@ -1502,8 +1503,6 @@ class TestCalendar(ERP5ReportTestCase):
'calendar_period_type/type3': 1.5,})
import unittest
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCalendar))
......
......@@ -27,13 +27,13 @@
##############################################################################
import unittest
from unittest import expectedFailure
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestNestedLineMixin(TestSaleInvoiceMixin):
......
......@@ -29,6 +29,7 @@
import os
import unittest
from unittest import expectedFailure
from DateTime import DateTime
from Products.ERP5Type.Utils import convertToUpperCase
......@@ -36,7 +37,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.tests.utils import createZODBPythonScript, FileUpload
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestERP5Base(ERP5TypeTestCase):
"""ERP5 Base tests.
......
......@@ -29,11 +29,12 @@
import os
import string
import unittest
import urllib
from unittest import skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.tests.backportUnittest import skip
SESSION_ID = "12345678"
LANGUAGE_LIST = ('en', 'fr', 'de', 'bg',)
......@@ -937,8 +938,6 @@ class TestCommerce(ERP5TypeTestCase):
sale_order_object_list = self.portal.sale_order_module.contentValues()
self.assertEqual(comment, sale_order_object_list[0].getComment())
import unittest
def test_suite():
suite = unittest.TestSuite()
......
......@@ -32,7 +32,6 @@
import unittest
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5OOo.tests.testDms import makeFileUpload
......
......@@ -28,7 +28,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.testERP5TypeInterfaces import addTestMethodDynamically
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from unittest import expectedFailure
import unittest
# this list can be generated automatically using introspection or can be set
......
......@@ -30,6 +30,7 @@
import re
import unittest
from unittest import expectedFailure, skip
from AccessControl import Unauthorized
from Testing import ZopeTestCase
from DateTime import DateTime
......@@ -37,7 +38,6 @@ from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import DummyLocalizer
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Type.tests.backportUnittest import expectedFailure, skip
LANGUAGE_LIST = ('en', 'fr', 'de', 'bg', )
HTTP_OK = 200
......
......@@ -31,7 +31,6 @@
import unittest
import time
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.Formulator.Errors import ValidationError
from Products.ERP5Type.Document import newTempBase
from DateTime import DateTime
......
......@@ -40,6 +40,7 @@
import unittest
from unittest import expectedFailure
from Products.ERP5Type.Utils import cartesianProduct
from copy import copy
......@@ -51,7 +52,6 @@ from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5Type.DateUtils import addToDate
from Products.ERP5.tests.testOrder import TestOrderMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Form.Selection import DomainSelection
from Products.ERP5Type.tests.utils import createZODBPythonScript
from textwrap import dedent
......
......@@ -35,6 +35,7 @@ TODO: test variation
import os
import random
import unittest
from unittest import expectedFailure
from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime
......@@ -42,7 +43,6 @@ from MySQLdb import ProgrammingError
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5.Tool.SimulationTool import MYSQL_MIN_DATETIME_RESOLUTION
......
......@@ -28,10 +28,10 @@
##############################################################################
import unittest
from unittest import expectedFailure
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.Base import TempBase
from Products.ERP5OOo.tests.testDms import makeFileUpload,TestDocumentMixin, TestDocument
......
......@@ -27,6 +27,7 @@
##############################################################################
import unittest
from unittest import skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime
......@@ -35,7 +36,6 @@ from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.tests.utils import reindex
from Products.ERP5.tests.testBPMCore import TestBPMMixin
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5.tests.utils import newSimulationExpectedFailure
class TestMRPMixin(TestBPMMixin):
......
......@@ -27,8 +27,8 @@
import unittest
import os
import time
from unittest import expectedFailure
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from DateTime import DateTime
# explicitly set Europe/Paris timezone
......
......@@ -27,13 +27,13 @@
##############################################################################
import unittest
from unittest import expectedFailure
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList
from DateTime import DateTime
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestResource(ERP5TypeTestCase):
"""
......
......@@ -33,7 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex
from Products.ERP5Type.tests.utils import SubcontentReindexingWrapper
from DateTime import DateTime
from Products.ERP5Type.tests.backportUnittest import expectedFailure
import transaction
class TestSupplyMixin:
......
......@@ -27,12 +27,11 @@
##############################################################################
import unittest
from unittest import expectedFailure
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.Sequence import SequenceList
from testTask import TestTaskMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5.tests.utils import newSimulationExpectedFailure
from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase
class TestTaskReportDivergenceMixin(TestTaskMixin, SecurityTestCase):
......
......@@ -30,9 +30,9 @@
"""Tests Template functionality"""
import unittest
from unittest import expectedFailure
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type import Permissions
from Products.ERP5Form.PreferenceTool import Priority
......
......@@ -31,12 +31,12 @@
from UserDict import UserDict
import random
import unittest
from unittest import expectedFailure
from Products.ERP5.tests.testBPMCore import TestBPMMixin
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import simple_decorator
from DateTime import DateTime
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.utils import createZODBPythonScript, updateCellList
......
......@@ -34,7 +34,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import to_utf8
from Products.ERP5Type.Utils import getMessageIdWithContext
from zLOG import LOG
from Products.ERP5Type.tests.backportUnittest import expectedFailure
# dependency order
target_business_templates = (
......
......@@ -38,7 +38,7 @@ from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import DummyLocalizer,\
createZODBPythonScript, FileUpload
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from unittest import expectedFailure
import httplib
from StringIO import StringIO
......
......@@ -37,8 +37,7 @@ from OFS.XMLExportImport import importXML
if int(os.environ.get('erp5_report_new_simulation_failures') or 0):
newSimulationExpectedFailure = lambda test: test
else:
from Products.ERP5Type.tests.backportUnittest import \
expectedFailure as newSimulationExpectedFailure
from unittest import expectedFailure as newSimulationExpectedFailure
# Keep a global reference to a ZODB storage so that we can import business
# template xml files. XXX this connection will remain open.
......
......@@ -29,6 +29,7 @@
import unittest
import sys
from unittest import expectedFailure
from _mysql_exceptions import ProgrammingError
from Testing import ZopeTestCase
......@@ -40,12 +41,10 @@ from DateTime import DateTime
from Products.ERP5Type.tests.utils import LogInterceptor
from Products.ERP5Type.tests.utils import createZODBPythonScript, todo_erp5, \
getExtraSqlConnectionStringList
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ZSQLCatalog.ZSQLCatalog import HOT_REINDEXING_FINISHED_STATE,\
HOT_REINDEXING_RECORDING_STATE, HOT_REINDEXING_DOUBLE_INDEXING_STATE
from Products.CMFActivity.Errors import ActivityFlushError
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from OFS.ObjectManager import ObjectManager
......
......@@ -29,6 +29,7 @@
##############################################################################
import unittest
from unittest import expectedFailure
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
......@@ -36,7 +37,6 @@ from zExceptions import Unauthorized
from AccessControl.ZopeGuards import guarded_hasattr
from DateTime import DateTime
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5Type.tests.testERP5Type import PropertySheetTestCase
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Form.PreferenceTool import Priority
......
......@@ -34,7 +34,7 @@ from Products.Formulator.FormToXML import formToXML
from Products.Formulator.TALESField import TALESMethod
import unittest
from lxml import etree
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from unittest import expectedFailure
class TestProxyField(ERP5TypeTestCase):
"""
......
......@@ -29,6 +29,7 @@
import unittest
from threading import Thread
from thread import get_ident
from unittest import skip
import transaction
import ZODB
......@@ -37,7 +38,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Form.Selection import Selection
from Products.ERP5Form.Tool.SelectionTool import SelectionTool
from Products.ERP5Type.tests.backportUnittest import skip
class TestSelectionTool(ERP5TypeTestCase):
......
......@@ -50,6 +50,7 @@ import time
import StringIO
from subprocess import Popen, PIPE
from cgi import FieldStorage
from unittest import expectedFailure
import ZPublisher.HTTPRequest
from Testing import ZopeTestCase
......@@ -74,7 +75,6 @@ import difflib
import re
from AccessControl import Unauthorized
from Products.ERP5Type import Permissions
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from DateTime import DateTime
QUIET = 0
......
......@@ -30,7 +30,6 @@
import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5OOo.tests.TestFormPrintoutMixin import TestFormPrintoutMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5Type.tests.utils import FileUpload
......
......@@ -30,8 +30,8 @@
##############################################################################
import unittest
from unittest import skip
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5OOo.tests.TestFormPrintoutMixin import TestFormPrintoutMixin
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.MimetypesRegistry.mime_types.magic import guessMime
......
......@@ -45,7 +45,7 @@ from Products.ERP5OOo.OOoUtils import OOoBuilder
from zLOG import LOG, INFO, ERROR
from Products.CMFCore.utils import getToolByName
from zExceptions import BadRequest
from Products.ERP5Type.tests.backportUnittest import expectedFailure
from unittest import expectedFailure
import urllib
import urllib2
import httplib
......
......@@ -32,7 +32,6 @@ import sys
import unittest
from cStringIO import StringIO
from zipfile import ZipFile
from Products.ERP5Type.tests.backportUnittest import skip
from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
......
......@@ -29,6 +29,7 @@
import os
from base64 import b16encode
from unittest import expectedFailure
import unittest
from AccessControl.SecurityManagement import newSecurityManager
......@@ -39,7 +40,6 @@ from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5SyncML.Tool import SynchronizationTool
from Products.ERP5SyncML.tests.testERP5SyncML import TestERP5SyncMLMixin
from Products.ERP5SyncML.Document import SyncMLSubscription
from Products.ERP5Type.tests.backportUnittest import expectedFailure
test_files = os.path.join(os.path.dirname(__file__), 'test_document')
FILENAME_REGULAR_EXPRESSION = "(?P<reference>[A-Z]{3,10})-\
......
......@@ -30,6 +30,7 @@
import unittest
from base64 import b64encode, b64decode, b16encode
from lxml import etree
from unittest import expectedFailure
from AccessControl.SecurityManagement import newSecurityManager
from ERP5Diff import ERP5Diff
......@@ -43,7 +44,6 @@ from Products.ERP5SyncML.SyncMLConstant import MAX_LEN
from Products.ERP5SyncML.Document import SyncMLSubscription
from Products.ERP5SyncML.tests.testERP5SyncMLMixin import TestERP5SyncMLMixin \
as TestMixin
from Products.ERP5Type.tests.backportUnittest import expectedFailure
class TestERP5SyncMLMixin(TestMixin):
......
......@@ -28,7 +28,6 @@
##############################################################################
from Products.ERP5TioSafe.tests.testPrestashopMixin import testPrestashopMixin
from Products.ERP5Type.tests.backportUnittest import skip
class TestProductERP5Synchronization(testPrestashopMixin):
""" This class allows to check different cases of Product's sync. """
......
......@@ -40,8 +40,7 @@ class TimeoutTransport(SafeTransport):
def make_connection(*args, **kw):
connection = transport_class.make_connection(self, *args, **kw)
if timeout is not None:
# BBB: On Python < 2.7, HTTP connection is wrapped
getattr(connection, '_conn', connection).timeout = timeout
connection.timeout = timeout
return connection
self.make_connection = make_connection
......@@ -49,6 +48,5 @@ class TimeoutTransport(SafeTransport):
try:
return SafeTransport.send_content(self, connection, request_body)
except socket.error, e:
# BBB: On Python < 2.7, HTTP connection is wrapped
raise ProtocolError(getattr(connection, '_conn', connection).host, -1,
raise ProtocolError(connection.host, -1,
"Could not connect to server", None)
......@@ -87,14 +87,13 @@ class LocalRoleAssignorMixIn(object):
if owner:
user_name = owner[1]
else:
for group, role_list in (ob.__ac_local_roles__ or {}).iteritems():
for user_name, role_list in (ob.__ac_local_roles__ or {}).iteritems():
if 'Owner' in role_list:
user_name = group
break
else:
user_name = getSecurityManager().getUser().getId()
group_id_role_dict = {user_name: set(('Owner',))}
group_id_role_dict = {user_name: {'Owner'}}
local_roles_group_id_group_id = {}
# Merge results from applicable roles
for role_generator in self.getFilteredRoleListFor(ob):
......@@ -116,18 +115,19 @@ class LocalRoleAssignorMixIn(object):
## Update role assignments to groups