Merge lp:~nataliabidart/ubuntu-sso-client/verify-works-when-login-only into lp:ubuntu-sso-client/stable-1-0

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 639
Merged at revision: 639
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/verify-works-when-login-only
Merge into: lp:ubuntu-sso-client/stable-1-0
Diff against target: 69 lines (+27/-2)
2 files modified
ubuntu_sso/gui.py (+1/-1)
ubuntu_sso/tests/test_gui.py (+26/-1)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/verify-works-when-login-only
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Alejandro J. Cura (community) Approve
Review via email: mp+39996@code.launchpad.net

Commit message

The verify email page should be always built, not only on registration.

Description of the change

To test, run the dbus daemon from this branch with:

killall ubuntu-sso-login; DEBUG=True PYTHONPATH=. ./bin/ubuntu-sso-login

Be sure to have a non-validated SSO user. If you don't have one, first register a new user but do not enter the verification code (just close the SSO window when prompted for email token). After doing this, be sure to kill the dbus daemon and restart it.

Then, execute the 'login_to_get_credentials' method in the ApplicationCredentials interface (dbus address com.ubuntu.sso/credentials) using d-feet. Parameters should be:

'Any app name', '', 0

Try to login with the non validated email address. You should get the email verification screen. If you weren't running this branch, you'd get an exception like this one:

    if current_page.default_widget is not None:
exceptions.AttributeError: 'gtk.VBox' object has no attribute 'default_widget'

To post a comment you must log in.
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Nice!

review: Approve
Revision history for this message
John Lenton (chipaca) wrote :

Awesome.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/gui.py'
2--- ubuntu_sso/gui.py 2010-11-01 21:01:14 +0000
3+++ ubuntu_sso/gui.py 2010-11-03 17:56:49 +0000
4@@ -321,13 +321,13 @@
5 self._append_page(self._build_login_page())
6 self._append_page(self._build_request_password_token_page())
7 self._append_page(self._build_set_new_password_page())
8+ self._append_page(self._build_verify_email_page())
9
10 window_size = None
11 if not login_only:
12 window_size = (550, 500)
13 self._append_page(self._build_enter_details_page())
14 self._append_page(self._build_tc_page())
15- self._append_page(self._build_verify_email_page())
16 self.login_button.grab_focus()
17 self._set_current_page(self.enter_details_vbox)
18 else:
19
20=== modified file 'ubuntu_sso/tests/test_gui.py'
21--- ubuntu_sso/tests/test_gui.py 2010-11-01 21:01:14 +0000
22+++ ubuntu_sso/tests/test_gui.py 2010-11-03 17:56:49 +0000
23@@ -1011,6 +1011,17 @@
24 dict(reply_handler=gui.NO_OP,
25 error_handler=gui.NO_OP)))
26
27+ def test_on_verify_token_button_clicked(self):
28+ """Verify token uses cached user_email and user_password."""
29+ self.ui.user_email = 'test@me.com'
30+ self.ui.user_password = 'yadda-yedda'
31+ self.ui.on_verify_token_button_clicked()
32+ self.assertEqual(self.ui.backend._called['validate_email'],
33+ ((APP_NAME, self.ui.user_email,
34+ self.ui.user_password, EMAIL_TOKEN),
35+ dict(reply_handler=gui.NO_OP,
36+ error_handler=gui.NO_OP)))
37+
38 def test_on_verify_token_button_shows_processing_page(self):
39 """Verify token button triggers call to backend."""
40 self.click_verify_email_with_valid_data()
41@@ -1085,7 +1096,7 @@
42
43
44 class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase):
45- """Test suite for the user registration (verify email page)."""
46+ """Test suite for the user registration validation (verify email page)."""
47
48 def setUp(self):
49 """Init."""
50@@ -1120,6 +1131,20 @@
51 self.assert_warnings_visibility()
52
53
54+class VerifyEmailLoginOnlyTestCase(VerifyEmailTestCase):
55+ """Test suite for the user login (verify email page)."""
56+
57+ kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
58+ login_only=True)
59+
60+
61+class VerifyEmailValidationLoginOnlyTestCase(VerifyEmailValidationTestCase):
62+ """Test suite for the user login validation (verify email page)."""
63+
64+ kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
65+ login_only=True)
66+
67+
68 class RegistrationValidationTestCase(UbuntuSSOClientTestCase):
69 """Test suite for the user registration validations."""
70

Subscribers

People subscribed via source and target branches