Merge ~cjwatson/launchpad:python-openid2-3.2+lp1 into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4df8f714578c3ab8ba91746d4035ef5ccdf9824d
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:python-openid2-3.2+lp1
Merge into: launchpad:master
Diff against target: 56 lines (+36/-1)
2 files modified
constraints.txt (+3/-1)
lib/lp/services/webapp/tests/login.txt (+33/-0)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+389437@code.launchpad.net

Commit message

Fix login for users with non-ASCII display names

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/constraints.txt b/constraints.txt
index 00eecfa..8a9077d 100644
--- a/constraints.txt
+++ b/constraints.txt
@@ -278,7 +278,9 @@ python-dateutil==2.8.1
278python-debian==0.1.32278python-debian==0.1.32
279python-keystoneclient==0.7.1279python-keystoneclient==0.7.1
280python-memcached==1.58280python-memcached==1.58
281python-openid2==3.2281# https://github.com/ziima/python-openid/pull/47
282# lp1 Fix normalization of non-ASCII query strings on Python 2.
283python-openid2==3.2+lp1
282python-swiftclient==2.0.3284python-swiftclient==2.0.3
283PyYAML==3.10285PyYAML==3.10
284rabbitfixture==0.4.2286rabbitfixture==0.4.2
diff --git a/lib/lp/services/webapp/tests/login.txt b/lib/lp/services/webapp/tests/login.txt
index ec6eeed..5b81348 100644
--- a/lib/lp/services/webapp/tests/login.txt
+++ b/lib/lp/services/webapp/tests/login.txt
@@ -49,3 +49,36 @@ logged in and ask us to log out if we're somebody else.
49 >>> browser.open('%s/+login' % root_url)49 >>> browser.open('%s/+login' % root_url)
50 >>> print extract_text(find_main_content(browser.contents))50 >>> print extract_text(find_main_content(browser.contents))
51 You are already logged in...51 You are already logged in...
52
53The same thing works if the user has non-ASCII characters in their display
54name.
55
56 >>> from lp.testing import (
57 ... ANONYMOUS,
58 ... login,
59 ... )
60 >>> from lp.testing.factory import LaunchpadObjectFactory
61
62 >>> login(ANONYMOUS)
63 >>> factory = LaunchpadObjectFactory()
64 >>> person = factory.makePerson(
65 ... email='unicode@example.com', name='unicode',
66 ... displayname=u'Un\xedc\xf6de Person')
67 >>> browser = Browser()
68 >>> browser.handleErrors = True
69 >>> browser.open(
70 ... '%s/people/?name=foo&searchfor=all' % root_url)
71 >>> browser.getLink('Log in / Register').click()
72 >>> print browser.contents
73 <html>...<body onload="document.forms[0].submit();"...
74 >>> browser.getControl('Continue').click()
75 >>> print browser.title
76 Login
77 >>> fill_login_form_and_submit(browser, 'unicode@example.com')
78 >>> browser.vhost
79 'http://launchpad.test'
80 >>> browser.urlpath
81 '/people'
82 >>> import re
83 >>> print sorted(re.sub('.*\?', '', browser.url).split('&'))
84 ['name=foo', 'searchfor=all']

Subscribers

People subscribed via source and target branches

to status/vote changes: