launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25985
[Merge] ~cjwatson/launchpad:py3-assertisinstance-unicode into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-assertisinstance-unicode into launchpad:master.
Commit message:
Port self.assertIsInstance(..., unicode) calls to Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/396111
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-assertisinstance-unicode into launchpad:master.
diff --git a/lib/lp/services/oauth/tests/test_tokens.py b/lib/lp/services/oauth/tests/test_tokens.py
index 7cdb5b3..b35ee25 100644
--- a/lib/lp/services/oauth/tests/test_tokens.py
+++ b/lib/lp/services/oauth/tests/test_tokens.py
@@ -14,6 +14,7 @@ from datetime import (
import hashlib
import pytz
+import six
from zope.component import getUtility
from zope.security.interfaces import Unauthorized
from zope.security.proxy import removeSecurityProxy
@@ -107,7 +108,7 @@ class TestRequestTokens(TestOAuth):
def test_newRequestToken(self):
request_token, secret = self.consumer.newRequestToken()
verifyObject(IOAuthRequestToken, request_token)
- self.assertIsInstance(secret, unicode)
+ self.assertIsInstance(secret, six.text_type)
self.assertEqual(
removeSecurityProxy(request_token)._secret,
hashlib.sha256(secret).hexdigest())
@@ -281,7 +282,7 @@ class TestAccessTokens(TestOAuth):
request_token, access_token, access_secret = (
self._exchange_request_token_for_access_token())
verifyObject(IOAuthAccessToken, access_token)
- self.assertIsInstance(access_secret, unicode)
+ self.assertIsInstance(access_secret, six.text_type)
self.assertEqual(
removeSecurityProxy(access_token)._secret,
hashlib.sha256(access_secret).hexdigest())
diff --git a/lib/lp/services/webapp/tests/test_errorlog.py b/lib/lp/services/webapp/tests/test_errorlog.py
index 3a04f8c..d45be30 100644
--- a/lib/lp/services/webapp/tests/test_errorlog.py
+++ b/lib/lp/services/webapp/tests/test_errorlog.py
@@ -239,7 +239,7 @@ class TestErrorReportingUtility(TestCaseWithFactory):
if isinstance(key, str):
key.decode('utf8')
else:
- self.assertIsInstance(key, unicode)
+ self.assertIsInstance(key, six.text_type)
def test_raising_with_webservice_request(self):
# Test ErrorReportingUtility.raising() with a WebServiceRequest