Colin Watson has proposed merging ~cjwatson/launchpad:python-openid2-3.2+lp1 into launchpad:master.
Commit message: Fix login for users with non-ASCII display names Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/389437 This applies https://github.com/ziima/python-openid/pull/47 to python-openid2. Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/389436 -- Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:python-openid2-3.2+lp1 into launchpad:master.
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 python-debian==0.1.32 python-keystoneclient==0.7.1 python-memcached==1.58 -python-openid2==3.2 +# https://github.com/ziima/python-openid/pull/47 +# lp1 Fix normalization of non-ASCII query strings on Python 2. +python-openid2==3.2+lp1 python-swiftclient==2.0.3 PyYAML==3.10 rabbitfixture==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. >>> browser.open('%s/+login' % root_url) >>> print extract_text(find_main_content(browser.contents)) You are already logged in... + +The same thing works if the user has non-ASCII characters in their display +name. + + >>> from lp.testing import ( + ... ANONYMOUS, + ... login, + ... ) + >>> from lp.testing.factory import LaunchpadObjectFactory + + >>> login(ANONYMOUS) + >>> factory = LaunchpadObjectFactory() + >>> person = factory.makePerson( + ... email='[email protected]', name='unicode', + ... displayname=u'Un\xedc\xf6de Person') + >>> browser = Browser() + >>> browser.handleErrors = True + >>> browser.open( + ... '%s/people/?name=foo&searchfor=all' % root_url) + >>> browser.getLink('Log in / Register').click() + >>> print browser.contents + <html>...<body onload="document.forms[0].submit();"... + >>> browser.getControl('Continue').click() + >>> print browser.title + Login + >>> fill_login_form_and_submit(browser, '[email protected]') + >>> browser.vhost + 'http://launchpad.test' + >>> browser.urlpath + '/people' + >>> import re + >>> print sorted(re.sub('.*\?', '', browser.url).split('&')) + ['name=foo', 'searchfor=all']
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp

