Merge lp:~elopio/u1-test-utils/fix-already_logged_in into lp:u1-test-utils

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 24
Merged at revision: 23
Proposed branch: lp:~elopio/u1-test-utils/fix-already_logged_in
Merge into: lp:u1-test-utils
Diff against target: 28 lines (+14/-3)
1 file modified
u1testutils/sst/sso/helpers.py (+14/-3)
To merge this branch: bzr merge lp:~elopio/u1-test-utils/fix-already_logged_in
Reviewer Review Type Date Requested Status
Leo Arias (community) Approve
Review via email: mp+145510@code.launchpad.net

Commit message

Fixed the case when the user is already logged in.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

Tested with the pay acceptance tests.

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/helpers.py'
2--- u1testutils/sst/sso/helpers.py 2013-01-29 14:50:38 +0000
3+++ u1testutils/sst/sso/helpers.py 2013-01-29 22:35:26 +0000
4@@ -66,11 +66,22 @@
5 information will be send to it. Default is True.
6
7 """
8- log_in = pages.LogIn()
9 if is_site_recognized:
10- log_in.log_in_to_site_recognized(user)
11+ if user is not None:
12+ log_in = pages.LogIn()
13+ log_in.log_in_to_site_recognized(user)
14+ else:
15+ # User is already signed in so SSO will just redirect back to the
16+ # main site.
17+ pass
18 else:
19- site_not_recognized = log_in.log_in_to_site_not_recognized(user)
20+ if user is not None:
21+ log_in = pages.LogIn()
22+ site_not_recognized = log_in.log_in_to_site_not_recognized(user)
23+ else:
24+ # User is already signed in so SSO will just show the site not
25+ # recognized page.
26+ site_not_recognized = pages.SiteNotRecognized()
27 site_not_recognized.make_all_information_available_to_website()
28 site_not_recognized.yes_sign_me_in()
29

Subscribers

People subscribed via source and target branches

to all changes: