Merge lp:~diegosarmentero/ubuntu-sso-client/ensure-overlay into lp:ubuntu-sso-client

Proposed by Diego Sarmentero on 2012-03-02
Status: Merged
Approved by: Natalia Bidart on 2012-03-02
Approved revision: 896
Merged at revision: 895
Proposed branch: lp:~diegosarmentero/ubuntu-sso-client/ensure-overlay
Merge into: lp:ubuntu-sso-client
Diff against target: 75 lines (+9/-2)
2 files modified
ubuntu_sso/qt/email_verification_page.py (+3/-0)
ubuntu_sso/qt/tests/test_email_verification.py (+6/-2)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-sso-client/ensure-overlay
Reviewer Review Type Date Requested Status
Natalia Bidart Approve on 2012-03-02
Roberto Alsina (community) 2012-03-02 Approve on 2012-03-02
Review via email: mp+95636@code.launchpad.net

Commit Message

- Fixed: Qt UI: there is not loading overvaly while validating an email address
  (LP: #944767).

To post a comment you must log in.
896. By Diego Sarmentero on 2012-03-02

adding hide_overlay when the process ends.

Roberto Alsina (ralsina) wrote :

+1

review: Approve
Natalia Bidart (nataliabidart) wrote :

Looks and works good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/qt/email_verification_page.py'
2--- ubuntu_sso/qt/email_verification_page.py 2012-03-01 20:46:34 +0000
3+++ ubuntu_sso/qt/email_verification_page.py 2012-03-02 18:40:22 +0000
4@@ -107,6 +107,7 @@
5 code = unicode(self.ui.verification_code_edit.text())
6 args = (self.app_name, self.email, self.password, code)
7 self.hide_error()
8+ self.show_overlay()
9 if self.ping_url:
10 f = self.backend.validate_email_and_ping
11 args = args + (self.ping_url,)
12@@ -123,10 +124,12 @@
13 def on_email_validated(self, app_name, *args, **kwargs):
14 """Signal thrown after the email is validated."""
15 logger.info('EmailVerificationController.on_email_validated')
16+ self.hide_overlay()
17 self.registrationSuccess.emit(app_name, self.email)
18
19 def on_email_validation_error(self, app_name, error):
20 """Signal thrown when there's a problem validating the email."""
21+ self.hide_overlay()
22 msg = error.pop(ERROR_EMAIL_TOKEN, '')
23 msg += build_general_error_message(error)
24 self.show_error(self.app_name, msg)
25
26=== modified file 'ubuntu_sso/qt/tests/test_email_verification.py'
27--- ubuntu_sso/qt/tests/test_email_verification.py 2012-03-01 20:46:34 +0000
28+++ ubuntu_sso/qt/tests/test_email_verification.py 2012-03-02 18:40:22 +0000
29@@ -20,7 +20,7 @@
30
31 from ubuntu_sso.qt import email_verification_page
32 from ubuntu_sso.qt.tests import (
33- BaseTestCase,
34+ BaseTestCasePage,
35 FakePageUiStyle,
36 )
37
38@@ -28,7 +28,7 @@
39 # pylint: disable=W0212
40
41
42-class EmailVerificationTestCase(BaseTestCase):
43+class EmailVerificationTestCase(BaseTestCasePage):
44 """Test the SetupAccountPage code."""
45
46 ui_class = email_verification_page.EmailVerificationPage
47@@ -105,6 +105,7 @@
48 self.ui.on_email_validation_error(app_name, error)
49 expected = ((self.ui, app_name, ''), {})
50 self.assertTrue(expected, self._called)
51+ self.assertEqual(self._overlay_hide_counter, 1)
52
53 def test_on_email_validated(self):
54 """Test the on_email_validated method."""
55@@ -119,6 +120,7 @@
56 self.ui.registrationSuccess.connect(slot)
57 self.ui.on_email_validated(app_name)
58 self.assertIn((app_name, email), self.signals_results)
59+ self.assertEqual(self._overlay_hide_counter, 1)
60
61 def test_validate_email_with_ping(self):
62 """Test the login method."""
63@@ -136,6 +138,7 @@
64 self.app_name, email, password, code, self.ping_url)
65 expected = ((), {})
66 self.assertEqual(expected, self._called)
67+ self.assertEqual(self._overlay_show_counter, 1)
68
69 def test_validate_email_without_ping(self):
70 """Test the login method."""
71@@ -154,3 +157,4 @@
72 self.app_name, email, password, code)
73 expected = ((), {})
74 self.assertEqual(expected, self._called)
75+ self.assertEqual(self._overlay_show_counter, 1)

Subscribers

People subscribed via source and target branches