← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-simplify-getUniqueURL-calls into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-simplify-getUniqueURL-calls into launchpad:master.

Commit message:
Remove unnecessary unicode() from getUniqueURL calls

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/389994

getUniqueURL already returns Unicode as of 8e3497e6e3, so there's no need to wrap it in unicode(), and doing so is an obstacle to porting to Python 3.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-simplify-getUniqueURL-calls into launchpad:master.
diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py
index 455ff57..c854d14 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipe.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipe.py
@@ -908,7 +908,7 @@ class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,
         self.setConfig()
 
     def test_view_oci_push_rules_owner(self):
-        url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         registry_credentials = getUtility(IOCIRegistryCredentialsSet).new(
             registrant=self.person, owner=self.person, url=url,
@@ -942,7 +942,7 @@ class TestOCIRecipeEditPushRulesView(OCIConfigHelperMixin,
                         "Image name", "td", text=image_name))))
 
     def test_view_oci_push_rules_non_owner(self):
-        url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         registry_credentials = getUtility(IOCIRegistryCredentialsSet).new(
             registrant=self.person, owner=self.person, url=url,
diff --git a/lib/lp/registry/browser/tests/test_person.py b/lib/lp/registry/browser/tests/test_person.py
index 55ab037..2008a61 100644
--- a/lib/lp/registry/browser/tests/test_person.py
+++ b/lib/lp/registry/browser/tests/test_person.py
@@ -1355,7 +1355,7 @@ class TestPersonOCIRegistryCredentialsView(
 
     def test_view_oci_registry_credentials(self):
         # Verify view helper attributes.
-        url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         getUtility(IOCIRegistryCredentialsSet).new(
             registrant=self.user, owner=self.owner, url=url,
@@ -1370,9 +1370,9 @@ class TestPersonOCIRegistryCredentialsView(
                 Equals(credentials))))
 
     def test_edit_oci_registry_credentials(self):
-        url = unicode(self.factory.getUniqueURL())
-        newurl = unicode(self.factory.getUniqueURL())
-        third_url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
+        newurl = self.factory.getUniqueURL()
+        third_url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         registry_credentials = getUtility(IOCIRegistryCredentialsSet).new(
             registrant=self.user, owner=self.owner, url=url,
@@ -1451,7 +1451,7 @@ class TestPersonOCIRegistryCredentialsView(
                         })))
 
     def test_add_oci_registry_credentials(self):
-        url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         image_name = self.factory.getUniqueUnicode()
         registry_credentials = getUtility(IOCIRegistryCredentialsSet).new(
@@ -1502,7 +1502,7 @@ class TestPersonOCIRegistryCredentialsView(
     def test_delete_oci_registry_credentials(self):
         # Test that we do not delete credentials when there are
         # push rules defined to use them
-        url = unicode(self.factory.getUniqueURL())
+        url = self.factory.getUniqueURL()
         credentials = {'username': 'foo', 'password': 'bar'}
         registry_credentials = getUtility(IOCIRegistryCredentialsSet).new(
             registrant=self.user, owner=self.owner, url=url,