[damned-lies] Fixed unicode content in author widget



commit 701a9610a29fcb74b5df574974003bce122c6510
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Aug 22 14:54:23 2014 +0200

    Fixed unicode content in author widget

 vertimus/forms.py       |    2 +-
 vertimus/tests/tests.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vertimus/forms.py b/vertimus/forms.py
index 5b627c1..918b293 100644
--- a/vertimus/forms.py
+++ b/vertimus/forms.py
@@ -52,7 +52,7 @@ class AuthorWidget(forms.Select):
                 label += ugettext(" (full name missing)")
             elif val in selected_choices:
                 selected_html = mark_safe(' selected="selected"')
-            output.append(format_html('<option value="{0}"{1}>{2}</option>',
+            output.append(format_html(u'<option value="{0}"{1}>{2}</option>',
                 val, selected_html, label))
         return '\n'.join(output)
 
diff --git a/vertimus/tests/tests.py b/vertimus/tests/tests.py
index f8d5376..5c78d79 100644
--- a/vertimus/tests/tests.py
+++ b/vertimus/tests/tests.py
@@ -316,7 +316,7 @@ class VertimusTest(TeamsAndRolesTests):
 
         action = Action.new_by_name('WC', person=self.pt, comment="Hi!")
         action.apply_on(state, {'send_to_ml': action.send_mail_to_ml})
-        p3 = Person.objects.create(username='username')
+        p3 = Person.objects.create(username=u'ûsername')
         action = Action.new_by_name('WC', person=p3, comment="Hello!")
         action.apply_on(state, {'send_to_ml': action.send_mail_to_ml})
 
@@ -332,7 +332,7 @@ class VertimusTest(TeamsAndRolesTests):
             ['John Reviewer', 'John Translator'])
         self.assertEqual(form.fields['author'].initial, self.pr)
         rendered_form = form.as_p()
-        self.assertIn('<option value="%d" disabled="disabled">username (full name missing)</option>' % p3.pk,
+        self.assertIn(u'<option value="%d" disabled="disabled">ûsername (full name missing)</option>' % 
p3.pk,
                       rendered_form)
         self.assertIn('<option value="%d">John Translator</option>' % self.pt.pk,
                       rendered_form)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]