launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #06227
[Merge] lp:~mabac/launchpad/login-raises-non-string into lp:launchpad
Mattias Backman has proposed merging lp:~mabac/launchpad/login-raises-non-string into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~mabac/launchpad/login-raises-non-string/+merge/91265
Hi,
This branch adds a check to login() in lib/lp/testing/_login.py so that it raises an error if the email parameter is not a string.
Thanks,
Mattias
--
https://code.launchpad.net/~mabac/launchpad/login-raises-non-string/+merge/91265
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mabac/launchpad/login-raises-non-string into lp:launchpad.
=== modified file 'lib/lp/testing/_login.py'
--- lib/lp/testing/_login.py 2012-01-01 02:58:52 +0000
+++ lib/lp/testing/_login.py 2012-02-02 13:10:31 +0000
@@ -69,6 +69,8 @@
setPrincipal(), otherwise it must allow setting its principal attribute.
"""
+ if not isinstance(email, str):
+ raise ValueError("Expected email parameter to be a string.")
participation = _test_login_impl(participation)
setupInteractionByEmail(email, participation)