Merge lp:~diegosarmentero/ubuntu-sso-client/reset-password into lp:ubuntu-sso-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: Roberto Alsina
Approved revision: 779
Merged at revision: 779
Proposed branch: lp:~diegosarmentero/ubuntu-sso-client/reset-password
Merge into: lp:ubuntu-sso-client
Diff against target: 87 lines (+22/-5)
2 files modified
ubuntu_sso/qt/gui.py (+10/-2)
ubuntu_sso/qt/tests/test_reset_password.py (+12/-3)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-sso-client/reset-password
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Natalia Bidart (community) Approve
Review via email: mp+74211@code.launchpad.net

Commit message

- Fixed Reset Password (added Titles to that page) (LP: #842813).

Description of the change

Fixed Reset Password.
Added Titles to that page.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Please file a bug and link it to this proposal. Thanks!

779. By Diego Sarmentero

Assigning bug

Revision history for this message
Roberto Alsina (ralsina) :
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/gui.py'
2--- ubuntu_sso/qt/gui.py 2011-09-02 13:17:08 +0000
3+++ ubuntu_sso/qt/gui.py 2011-09-06 15:21:25 +0000
4@@ -16,6 +16,8 @@
5 # with this program. If not, see <http://www.gnu.org/licenses/>.
6 """Qt implementation of the UI."""
7
8+import gettext
9+
10 from PyQt4.QtCore import pyqtSignal, Qt, SIGNAL
11 from PyQt4.QtGui import (
12 QApplication,
13@@ -53,7 +55,11 @@
14 UbuntuSSOWizardController)
15
16
17+_ = gettext.gettext
18 logger = setup_logging('ubuntu_sso.gui')
19+RESET_TITLE = _("Reset password")
20+RESET_SUBTITLE = _("A password reset code has been sent to your e-mail."
21+ "Please enter the code below along with your new password.")
22
23
24 class Header(QWidget):
25@@ -101,8 +107,8 @@
26 self.ui.setupUi(self)
27 self.header = Header()
28 self.layout().insertWidget(0, self.header)
29- if controller:
30- self.controller = controller
31+ self.controller = controller
32+ if self.controller:
33 self.controller.setupUi(self)
34 self.next = -1
35
36@@ -316,6 +322,8 @@
37 super(ResetPasswordPage, self).initializePage()
38 common.password_default_assistance(self.ui.password_assistance)
39 self.ui.password_assistance.setVisible(False)
40+ self.setTitle(RESET_TITLE)
41+ self.setSubTitle(RESET_SUBTITLE)
42
43 def showEvent(self, event):
44 """Connect focusChanged signal from the application."""
45
46=== modified file 'ubuntu_sso/qt/tests/test_reset_password.py'
47--- ubuntu_sso/qt/tests/test_reset_password.py 2011-09-02 12:48:10 +0000
48+++ ubuntu_sso/qt/tests/test_reset_password.py 2011-09-06 15:21:25 +0000
49@@ -20,7 +20,7 @@
50 from twisted.trial.unittest import TestCase
51
52 from ubuntu_sso.qt import common
53-from ubuntu_sso.qt.gui import ResetPasswordPage
54+from ubuntu_sso.qt.gui import ResetPasswordPage, RESET_SUBTITLE, RESET_TITLE
55 # pylint: disable=F0401,E0611
56 from ubuntu_sso.qt.reset_password_ui import Ui_ResetPasswordPage
57 # pylint: enable=F0401,E0611
58@@ -40,11 +40,11 @@
59 FakePasswordAssistance._called = False
60
61
62-class SetupAccountTestCase(TestCase):
63+class ResetPasswordTestCase(TestCase):
64 """Test the ResetPasswordPage code."""
65
66 def setUp(self):
67- super(SetupAccountTestCase, self).setUp()
68+ super(ResetPasswordTestCase, self).setUp()
69 self.page = ResetPasswordPage(Ui_ResetPasswordPage(),
70 None,
71 None)
72@@ -57,6 +57,15 @@
73 self.assertEqual(self.page.ui.confirm_password_line_edit.receivers(
74 QtCore.SIGNAL('textEdited(QString)')), 1)
75
76+ def test_initialize(self):
77+ """Check the Title and Subtitle."""
78+ self.page.show()
79+ self.page.initializePage()
80+ self.addCleanup(self.page.hide)
81+ self.assertEqual(self.page.header.title_label.text(), RESET_TITLE)
82+ self.assertEqual(self.page.header.subtitle_label.text(),
83+ RESET_SUBTITLE)
84+
85 def test_focus_changed_password_visibility(self):
86 """Check visibility changes when focus_changed() is executed."""
87 self.page.show()

Subscribers

People subscribed via source and target branches