← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:doctest-urllib-quoting into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:doctest-urllib-quoting into launchpad:master.

Commit message:
Adjust expected URLs for Python >= 3.7

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

Python 3.7 updated `urllib` quoting to RFC 3986, adding `~` to the set of reserved characters.  This broke a couple of doctests.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:doctest-urllib-quoting into launchpad:master.
diff --git a/lib/lp/registry/stories/team-polls/create-polls.rst b/lib/lp/registry/stories/team-polls/create-polls.rst
index be46e7a..22fb89a 100644
--- a/lib/lp/registry/stories/team-polls/create-polls.rst
+++ b/lib/lp/registry/stories/team-polls/create-polls.rst
@@ -115,6 +115,8 @@ Create a new poll that starts tomorrow and will last for ten years.
 
 We're redirected to the newly created poll
 
+    >>> from urllib.parse import unquote
+
     >>> team_admin_browser.url
     'http://launchpad.test/~ubuntu-team/+poll/dpl-2080'
     >>> print(team_admin_browser.title)
@@ -129,8 +131,8 @@ We're redirected to the newly created poll
     * Translations - http://translations.launchpad.test/~ubuntu-team
     * Answers - http://answers.launchpad.test/~ubuntu-team
     Main heading: Debian Project Leader Election 2080
-    >>> team_admin_browser.getLink('add an option').url
-    'http://launchpad.test/%7Eubuntu-team/+poll/dpl-2080/+newoption'
+    >>> unquote(team_admin_browser.getLink('add an option').url)
+    'http://launchpad.test/~ubuntu-team/+poll/dpl-2080/+newoption'
 
 Now lets try to insert a poll with the name of a existing one.
 
diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst b/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
index 1fe0292..022ee56 100644
--- a/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
+++ b/lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst
@@ -180,9 +180,11 @@ This is the last page, so the next and last links are inactive.
 
 The 'First' and 'Previous' links, however, are now active.
 
-    >>> anon_browser.getLink('First').url
-    'http://launchpad.test/%7Ecprov/+archive/ubuntu/ppa/+index?batch=1'
+    >>> from urllib.parse import unquote
 
-    >>> anon_browser.getLink('Previous').url  # noqa
-    'http://launchpad.test/%7Ecprov/+archive/ubuntu/ppa/+index?batch=1&direction=backwards&memo=2&start=1'
+    >>> unquote(anon_browser.getLink('First').url)
+    'http://launchpad.test/~cprov/+archive/ubuntu/ppa/+index?batch=1'
+
+    >>> unquote(anon_browser.getLink('Previous').url)  # noqa
+    'http://launchpad.test/~cprov/+archive/ubuntu/ppa/+index?batch=1&direction=backwards&memo=2&start=1'