summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-31 11:39:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-31 11:39:06 +0000
commit24bacb19dea298943f54155f911df380c73f9ea2 (patch)
treecb8a7cd108f6eec1eb0294fe105c6a0c65d482f8 /tests/regressiontests
parenta63a83e5d88cd1696d1c40e89f254f69116c6800 (diff)
Fixed #5216 -- Fixed a case of a string not being a unicode string.
Thanks to Vadim Fint for the test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8761 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/forms/regressions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/regressions.py b/tests/regressiontests/forms/regressions.py
index 87390d3cd1..5e32cd397d 100644
--- a/tests/regressiontests/forms/regressions.py
+++ b/tests/regressiontests/forms/regressions.py
@@ -34,6 +34,16 @@ early and still send back the right translation.
u'<p><label for="id_username">Nazwa u\u017cytkownika:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>'
>>> deactivate()
+There was some problems with form translations in #5216
+>>> class SomeForm(Form):
+... field_1 = CharField(max_length=10, label=ugettext_lazy('field_1'))
+... field_2 = CharField(max_length=10, label=ugettext_lazy('field_2'), widget=TextInput(attrs={'id': 'field_2_id'}))
+>>> f = SomeForm()
+>>> print f['field_1'].label_tag()
+<label for="id_field_1">field_1</label>
+>>> print f['field_2'].label_tag()
+<label for="field_2_id">field_2</label>
+
Unicode decoding problems...
>>> GENDERS = ((u'\xc5', u'En tied\xe4'), (u'\xf8', u'Mies'), (u'\xdf', u'Nainen'))
>>> class SomeForm(Form):