Commit 8958c4f8 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

WIP: py2/py3: make erp5_core_test code compatible.

parent a5714297
......@@ -28,7 +28,7 @@
##############################################################################
from functools import partial
import httplib
import six.moves.http_client
from random import randint
import sys
import threading
......@@ -4113,7 +4113,7 @@ VALUES
ret = self.publish(
self.portal.portal_catalog.getPath(),
basic='ERP5TypeTestCase:')
self.assertEqual(httplib.OK, ret.getStatus())
self.assertEqual(six.moves.http_client.OK, ret.getStatus())
# check if we did not just publish the result of `str(portal_catalog.__call__())`,
# but a proper page
self.assertIn('<title>Catalog Tool - portal_catalog', ret.getBody())
......
......@@ -28,8 +28,8 @@
##############################################################################
import pprint
import httplib
import urlparse
import six.moves.http_client
import six.moves.urllib.parse
import base64
import urllib
import lxml.html
......@@ -629,9 +629,9 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
self.commit()
self.tic()
_, api_netloc, _, _, _ = urlparse.urlsplit(self.portal.absolute_url())
_, api_netloc, _, _, _ = six.moves.urllib.parse.urlsplit(self.portal.absolute_url())
connection = httplib.HTTPConnection(api_netloc)
connection = six.moves.http_client.HTTPConnection(api_netloc)
connection.request(
method='GET',
url='%s/Person_getPrimaryGroup' % \
......
......@@ -29,7 +29,7 @@
try:
from ZODB._compat import cPickle
except ImportError: # BBB: ZODB < 4
import cPickle
import six.moves.cPickle
import unittest
import sys
import mock
......@@ -330,7 +330,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
portal.person_module._setObject(o.getId(), aq_base(o))
try:
self.commit()
except cPickle.PicklingError:
except six.moves.cPickle.PicklingError:
self.abort()
else:
self.fail("No exception raised when storing explicitly a temp object"
......
......@@ -29,7 +29,7 @@
import contextlib
import unittest
from threading import Thread
from thread import get_ident
from six.moves._thread import get_ident
from unittest import skip
import transaction
......
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