Merge lp:~nataliabidart/ubuntu-sso-client/clean-captcha-error-trunk into lp:ubuntu-sso-client

Proposed by Natalia Bidart on 2011-03-30
Status: Merged
Approved by: Natalia Bidart on 2011-03-30
Approved revision: 690
Merged at revision: 690
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/clean-captcha-error-trunk
Merge into: lp:ubuntu-sso-client
Diff against target: 28 lines (+7/-0)
2 files modified
ubuntu_sso/gtk/gui.py (+1/-0)
ubuntu_sso/gtk/tests/test_gui.py (+6/-0)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/clean-captcha-error-trunk
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2011-03-30
Eric Casteleijn (community) 2011-03-30 Approve on 2011-03-30
Review via email: mp+55606@code.launchpad.net

Commit message

- Captcha load warning is removed when retry is successful (LP: #703115).

To post a comment you must log in.
Eric Casteleijn (thisfred) :
review: Approve
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_sso/gtk/gui.py'
2--- ubuntu_sso/gtk/gui.py 2011-03-16 01:36:07 +0000
3+++ ubuntu_sso/gtk/gui.py 2011-03-30 17:48:31 +0000
4@@ -526,6 +526,7 @@
5 """Ask for a new captcha; update the ui to reflect the fact."""
6 logger.info('Calling generate_captcha with filename path at %r',
7 self._captcha_filename)
8+ self.warning_label.set_text('')
9 self.backend.generate_captcha(self.app_name, self._captcha_filename,
10 reply_handler=NO_OP, error_handler=NO_OP)
11 self._set_captcha_loading()
12
13=== modified file 'ubuntu_sso/gtk/tests/test_gui.py'
14--- ubuntu_sso/gtk/tests/test_gui.py 2011-03-16 01:36:07 +0000
15+++ ubuntu_sso/gtk/tests/test_gui.py 2011-03-30 17:48:31 +0000
16@@ -880,6 +880,12 @@
17 self.ui.CAPTCHA_LOAD_ERROR)
18 self.assertEqual(self._called, ((), {}))
19
20+ def test_captcha_success_after_error(self):
21+ """When captcha was retrieved after error, the warning is removed."""
22+ self.ui.on_captcha_generation_error(APP_NAME, error=self.error)
23+ self.ui.on_captcha_generated(app_name=APP_NAME, captcha_id=CAPTCHA_ID)
24+ self.assertEqual(self.ui.warning_label.get_text(), '')
25+
26
27 class NoTermsAndConditionsTestCase(UbuntuSSOClientTestCase):
28 """Test suite for the user registration (with no t&c link)."""

Subscribers

People subscribed via source and target branches