Merge lp:~diegosarmentero/ubuntuone-windows-installer/not-validated-account into lp:ubuntuone-windows-installer

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 90
Merged at revision: 95
Proposed branch: lp:~diegosarmentero/ubuntuone-windows-installer/not-validated-account
Merge into: lp:ubuntuone-windows-installer
Diff against target: 88 lines (+39/-0)
2 files modified
ubuntuone_installer/gui/qt/gui.py (+12/-0)
ubuntuone_installer/gui/qt/tests/test_gui.py (+27/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/not-validated-account
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
Alejandro J. Cura (community) Approve
Review via email: mp+83054@code.launchpad.net

Commit message

Fixed: When logging in with an no-yet-validated account, there is no useful message (LP: #851885).

Description of the change

Fixed: When logging in with an no-yet-validated account, there is no useful message (LP: #851885).

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

+1

review: Approve
Revision history for this message
Manuel de la Peña (mandel) wrote :

I see an issue with the fact that the cleanupPage is using a private variable and is not present in a test class. Either move the method to the wizard class of make the _next_id attribute public.

review: Needs Information
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

> I see an issue with the fact that the cleanupPage is using a private variable
> and is not present in a test class. Either move the method to the wizard class
> of make the _next_id attribute public.

Bug report created to do that refactor:
https://bugs.launchpad.net/ubuntuone-windows-installer/+bug/903668

Revision history for this message
Manuel de la Peña (mandel) wrote :

Ok, I'll approve the branch because is done everywhere, but please remember that the control flow of a page should be done in the nextId method.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone_installer/gui/qt/gui.py'
2--- ubuntuone_installer/gui/qt/gui.py 2011-11-11 20:36:16 +0000
3+++ ubuntuone_installer/gui/qt/gui.py 2011-11-22 17:54:30 +0000
4@@ -213,6 +213,10 @@
5 self.ui.sign_in_button.style().polish(
6 self.ui.sign_in_button)
7
8+ def cleanupPage(self):
9+ """Reset the state of the wizard if Verification code was visited."""
10+ self.wizard()._next_id = None
11+
12
13 class SuccessPage(SSOWizardPage):
14 """Shown after SSO login, before setup."""
15@@ -305,6 +309,7 @@
16 # definition of the signals raised by the widget (for SSO)
17 recoverableError = QtCore.pyqtSignal('QString', 'QString')
18 loginSuccess = QtCore.pyqtSignal('QString', 'QString')
19+ registrationIncomplete = QtCore.pyqtSignal('QString', 'QString')
20 registrationSuccess = QtCore.pyqtSignal('QString', 'QString')
21 userCancellation = QtCore.pyqtSignal('QString')
22
23@@ -412,6 +417,7 @@
24 self.reset_password_page_id = self.addPage(self.reset_password)
25
26 self.loginSuccess.connect(self.login_success_slot)
27+ self.registrationIncomplete.connect(self.registration_incomplete)
28 self.registrationSuccess.connect(self.registration_success_slot)
29
30 # End of SSO pages
31@@ -470,6 +476,12 @@
32 self.next()
33 self._next_id = self.SYNC_NOW_OR_LATER_PAGE
34
35+ def registration_incomplete(self):
36+ """Called when registration wasn't completed."""
37+ self._next_id = self.email_verification_page_id
38+ self.next()
39+ self._next_id = self.SUCCESS_PAGE
40+
41 def registration_success_slot(self):
42 """Called on successful registration."""
43 self._next_id = self.SUCCESS_PAGE
44
45=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
46--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-11-11 20:36:16 +0000
47+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-11-22 17:54:30 +0000
48@@ -347,6 +347,32 @@
49 folders_page.on_check_settings_button_clicked()
50 self.assertEqual(self.ui.currentId(), self.ui.preferences_page_id)
51
52+ def test_current_user_sign_in_page_clenaup(self):
53+ """Check CurrentUserSignIn cleanupPage method."""
54+ current_signin_page = self.ui.page(self.ui.current_user_page_id)
55+
56+ # Show the current id page
57+ self.ui.setStartId(self.ui.current_user_page_id)
58+ self.ui.restart()
59+ self.ui.show()
60+ self.addCleanup(self.ui.hide)
61+
62+ self.ui._next_id = self.ui.SUCCESS_PAGE
63+ current_signin_page.cleanupPage()
64+ self.assertEqual(self.ui._next_id, None)
65+
66+ def test_registration_incomplete(self):
67+ """Check the registration_incomplete slot."""
68+ self.ui.setStartId(self.ui.current_user_page_id)
69+ self.ui.restart()
70+ self.ui.show()
71+ self.addCleanup(self.ui.hide)
72+
73+ self.ui.registration_incomplete()
74+ self.assertEqual(self.ui.currentId(),
75+ self.ui.email_verification_page_id)
76+ self.assertEqual(self.ui._next_id, self.ui.SUCCESS_PAGE)
77+
78 def test_critical(self):
79 """Show a critical popup, but first hide the overlay."""
80 self.assertEqual(self.ui.overlay.hide_counter, 1)
81@@ -615,6 +641,7 @@
82
83 currentIdChanged = FakeSignal()
84 loginSuccess = FakeSignal()
85+ registrationIncomplete = FakeSignal()
86 registrationSuccess = FakeSignal()
87 userCancellation = FakeSignal()
88 shown = False

Subscribers

People subscribed via source and target branches