Merge lp:~diegosarmentero/ubuntu-sso-client/forgotten-link into lp:ubuntu-sso-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 903
Merged at revision: 906
Proposed branch: lp:~diegosarmentero/ubuntu-sso-client/forgotten-link
Merge into: lp:ubuntu-sso-client
Diff against target: 33 lines (+11/-1)
2 files modified
ubuntu_sso/qt/__init__.py (+1/-1)
ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+10/-0)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-sso-client/forgotten-link
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+96814@code.launchpad.net

Commit message

- Making LINK_STYLE to be unicode (LP: #950953).

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

Looks great! Thanks for catching this :-)

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/__init__.py'
2--- ubuntu_sso/qt/__init__.py 2012-03-05 18:56:50 +0000
3+++ ubuntu_sso/qt/__init__.py 2012-03-09 19:08:35 +0000
4@@ -19,7 +19,7 @@
5 import collections
6
7
8-LINK_STYLE = ('<a href="{link_url}">'
9+LINK_STYLE = (u'<a href="{link_url}">'
10 '<span style="color:#df2d1f;">{link_text}</span></a>')
11 ERROR_ALL = '__all__'
12 ERROR_STYLE = u'<font color="#df2d1f"><b>%s</b></font>'
13
14=== modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py'
15--- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-05 21:08:40 +0000
16+++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-09 19:08:35 +0000
17@@ -52,6 +52,16 @@
18 self.assertTrue(button.properties['default'])
19 self.assertFalse(button.isEnabled())
20
21+ def test_unicode_in_forgotten_password_link(self):
22+ """Ensure that this label supports unicode."""
23+ forgot_fr = u"J'ai oublié mon mot de passe"
24+ self.patch(gui, "FORGOTTEN_PASSWORD_BUTTON", forgot_fr)
25+ forgotten_text = gui.LINK_STYLE.format(link_url='#',
26+ link_text=forgot_fr)
27+ self.ui._set_translated_strings()
28+ self.assertEqual(unicode(self.ui.ui.forgot_password_label.text()),
29+ forgotten_text)
30+
31 def test_set_translated_strings(self):
32 """Test the translated string method."""
33 expected = gui.LOGIN_TITLE.format(app_name=self.app_name)

Subscribers

People subscribed via source and target branches