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

Proposed by Natalia Bidart on 2010-11-03
Status: Merged
Approved by: Natalia Bidart on 2010-11-03
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 Approve on 2010-11-03
Alejandro J. Cura (community) 2010-11-03 Approve on 2010-11-03
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.
Alejandro J. Cura (alecu) wrote :

Nice!

review: Approve
John Lenton (chipaca) wrote :

Awesome.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntu_sso/gui.py'
--- ubuntu_sso/gui.py 2010-11-01 21:01:14 +0000
+++ ubuntu_sso/gui.py 2010-11-03 17:56:49 +0000
@@ -321,13 +321,13 @@
321 self._append_page(self._build_login_page())321 self._append_page(self._build_login_page())
322 self._append_page(self._build_request_password_token_page())322 self._append_page(self._build_request_password_token_page())
323 self._append_page(self._build_set_new_password_page())323 self._append_page(self._build_set_new_password_page())
324 self._append_page(self._build_verify_email_page())
324325
325 window_size = None326 window_size = None
326 if not login_only:327 if not login_only:
327 window_size = (550, 500)328 window_size = (550, 500)
328 self._append_page(self._build_enter_details_page())329 self._append_page(self._build_enter_details_page())
329 self._append_page(self._build_tc_page())330 self._append_page(self._build_tc_page())
330 self._append_page(self._build_verify_email_page())
331 self.login_button.grab_focus()331 self.login_button.grab_focus()
332 self._set_current_page(self.enter_details_vbox)332 self._set_current_page(self.enter_details_vbox)
333 else:333 else:
334334
=== modified file 'ubuntu_sso/tests/test_gui.py'
--- ubuntu_sso/tests/test_gui.py 2010-11-01 21:01:14 +0000
+++ ubuntu_sso/tests/test_gui.py 2010-11-03 17:56:49 +0000
@@ -1011,6 +1011,17 @@
1011 dict(reply_handler=gui.NO_OP,1011 dict(reply_handler=gui.NO_OP,
1012 error_handler=gui.NO_OP)))1012 error_handler=gui.NO_OP)))
10131013
1014 def test_on_verify_token_button_clicked(self):
1015 """Verify token uses cached user_email and user_password."""
1016 self.ui.user_email = 'test@me.com'
1017 self.ui.user_password = 'yadda-yedda'
1018 self.ui.on_verify_token_button_clicked()
1019 self.assertEqual(self.ui.backend._called['validate_email'],
1020 ((APP_NAME, self.ui.user_email,
1021 self.ui.user_password, EMAIL_TOKEN),
1022 dict(reply_handler=gui.NO_OP,
1023 error_handler=gui.NO_OP)))
1024
1014 def test_on_verify_token_button_shows_processing_page(self):1025 def test_on_verify_token_button_shows_processing_page(self):
1015 """Verify token button triggers call to backend."""1026 """Verify token button triggers call to backend."""
1016 self.click_verify_email_with_valid_data()1027 self.click_verify_email_with_valid_data()
@@ -1085,7 +1096,7 @@
10851096
10861097
1087class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase):1098class VerifyEmailValidationTestCase(UbuntuSSOClientTestCase):
1088 """Test suite for the user registration (verify email page)."""1099 """Test suite for the user registration validation (verify email page)."""
10891100
1090 def setUp(self):1101 def setUp(self):
1091 """Init."""1102 """Init."""
@@ -1120,6 +1131,20 @@
1120 self.assert_warnings_visibility()1131 self.assert_warnings_visibility()
11211132
11221133
1134class VerifyEmailLoginOnlyTestCase(VerifyEmailTestCase):
1135 """Test suite for the user login (verify email page)."""
1136
1137 kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
1138 login_only=True)
1139
1140
1141class VerifyEmailValidationLoginOnlyTestCase(VerifyEmailValidationTestCase):
1142 """Test suite for the user login validation (verify email page)."""
1143
1144 kwargs = dict(app_name=APP_NAME, tc_uri=TC_URI, help_text=HELP_TEXT,
1145 login_only=True)
1146
1147
1123class RegistrationValidationTestCase(UbuntuSSOClientTestCase):1148class RegistrationValidationTestCase(UbuntuSSOClientTestCase):
1124 """Test suite for the user registration validations."""1149 """Test suite for the user registration validations."""
11251150

Subscribers

People subscribed via source and target branches