Merge lp:~elopio/u1-test-utils/sso_improvements into lp:u1-test-utils

Proposed by Leo Arias
Status: Merged
Approved by: Natalia Bidart
Approved revision: 19
Merged at revision: 18
Proposed branch: lp:~elopio/u1-test-utils/sso_improvements
Merge into: lp:u1-test-utils
Diff against target: 20 lines (+5/-6)
1 file modified
u1testutils/sst/sso/utils/mail.py (+5/-6)
To merge this branch: bzr merge lp:~elopio/u1-test-utils/sso_improvements
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+143778@code.launchpad.net

Commit message

Copied nessita's mail change from SSO.

Description of the change

Copied nessita's mail change from SSO.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Sounds about right!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1testutils/sst/sso/utils/mail.py'
2--- u1testutils/sst/sso/utils/mail.py 2013-01-16 15:16:50 +0000
3+++ u1testutils/sst/sso/utils/mail.py 2013-01-17 21:36:26 +0000
4@@ -42,13 +42,12 @@
5 vcode = match.group(1).strip()
6 else:
7 raise AssertionError("No verification code found in email.")
8- match = re.search(
9- 'confirm your (?:account|email address|reset):(.*)If',
10- body, re.S)
11- if match:
12- link = match.group(1).strip()
13+ links = map(str.strip, re.findall('^(http.*)$', body, re.MULTILINE))
14+ if links:
15+ link = links[0]
16 else:
17- raise AssertionError("No verification link found in email.")
18+ msg = "No verification link found in email. Email is:\n%r."
19+ raise AssertionError(msg % body)
20 return vcode, link
21
22

Subscribers

People subscribed via source and target branches

to all changes: