Merge lp:~diegosarmentero/ubuntu-sso-client/captcha-problem into lp:ubuntu-sso-client

Proposed by Diego Sarmentero on 2012-03-14
Status: Merged
Approved by: dobey on 2012-03-15
Approved revision: 913
Merged at revision: 912
Proposed branch: lp:~diegosarmentero/ubuntu-sso-client/captcha-problem
Merge into: lp:ubuntu-sso-client
Diff against target: 41 lines (+12/-1)
2 files modified
ubuntu_sso/qt/setup_account_page.py (+1/-1)
ubuntu_sso/qt/tests/test_setup_account.py (+11/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-sso-client/captcha-problem
Reviewer Review Type Date Requested Status
Natalia Bidart 2012-03-14 Approve on 2012-03-15
Roberto Alsina (community) Approve on 2012-03-14
Review via email: mp+97505@code.launchpad.net

Commit Message

- Executing hide_error when the user click the refresh captcha link, not inside of the _refresh_captcha method, because this is executed automatically when a captcha error is generated, so we will always miss the error message (LP: #955010).

To post a comment you must log in.
Roberto Alsina (ralsina) wrote :

+1

review: Approve
Natalia Bidart (nataliabidart) wrote :

Branch looks great!

Can you please tweak the test to be:

    def test_hide_error_on_refresh_clicked(self):
        """Hide form errors when the user click to refresh the captcha."""
        self.ui.show_error('error')
        self.assert_error_correct(self.ui.form_errors_label, 'error', max_width=self.ui.header.max_title_width)

        self.ui.ui.refresh_label.linkActivated.emit('error')

        self.assert_error_correct(self.ui.form_errors_label, ' ', max_width=self.ui.header.max_title_width)

review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/qt/setup_account_page.py'
2--- ubuntu_sso/qt/setup_account_page.py 2012-03-14 13:08:53 +0000
3+++ ubuntu_sso/qt/setup_account_page.py 2012-03-15 13:24:55 +0000
4@@ -233,6 +233,7 @@
5 self.ui.password_assistance,
6 common.NORMAL))
7
8+ self.ui.refresh_label.linkActivated.connect(self.hide_error)
9 self.ui.refresh_label.linkActivated.connect(lambda url: \
10 self._refresh_captcha())
11 # We need to check if we enable the button on many signals
12@@ -275,7 +276,6 @@
13 def _refresh_captcha(self):
14 """Refresh the captcha image shown in the ui."""
15 logger.debug('SetUpAccountPage._refresh_captcha')
16- self.hide_error()
17 # lets clean behind us, do we have the old file arround?
18 if self.captcha_file and os.path.exists(self.captcha_file):
19 os.unlink(self.captcha_file)
20
21=== modified file 'ubuntu_sso/qt/tests/test_setup_account.py'
22--- ubuntu_sso/qt/tests/test_setup_account.py 2012-03-14 12:16:06 +0000
23+++ ubuntu_sso/qt/tests/test_setup_account.py 2012-03-15 13:24:55 +0000
24@@ -47,6 +47,17 @@
25 self.assert_error_correct(self.ui.ui.name_assistance, gui.EMPTY_NAME,
26 max_width=self.ui.header.max_title_width)
27
28+ def test_hide_error_on_refresh_clicked(self):
29+ """Hide form errors when the user click to refresh the captcha."""
30+ self.ui.show_error('error')
31+ self.assert_error_correct(self.ui.form_errors_label, 'error',
32+ max_width=self.ui.header.max_title_width)
33+
34+ self.ui.ui.refresh_label.linkActivated.emit('error')
35+
36+ message = unicode(self.ui.form_errors_label.text())
37+ self.assertEqual(message, ' ')
38+
39 def test_enable_setup_button_with_visible_check(self):
40 """Test _enable_setup_button method with terms check visible."""
41 self.patch(self.ui, "set_up_button", QtGui.QPushButton())

Subscribers

People subscribed via source and target branches