mirror of https://github.com/django/django.git
[1.8.x] Adapted form regression test to new translations
Backport of 2112b7d78
from master.
This commit is contained in:
parent
5a4f95805f
commit
70c5031d56
|
@ -29,16 +29,16 @@ class FormsRegressionsTestCase(TestCase):
|
|||
# There were some problems with form translations in #3600
|
||||
|
||||
class SomeForm(Form):
|
||||
username = CharField(max_length=10, label=ugettext_lazy('Username'))
|
||||
username = CharField(max_length=10, label=ugettext_lazy('username'))
|
||||
|
||||
f = SomeForm()
|
||||
self.assertHTMLEqual(f.as_p(), '<p><label for="id_username">Username:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>')
|
||||
self.assertHTMLEqual(f.as_p(), '<p><label for="id_username">username:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>')
|
||||
|
||||
# Translations are done at rendering time, so multi-lingual apps can define forms)
|
||||
with translation.override('de'):
|
||||
self.assertHTMLEqual(f.as_p(), '<p><label for="id_username">Benutzername:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>')
|
||||
with translation.override('pl'):
|
||||
self.assertHTMLEqual(f.as_p(), '<p><label for="id_username">Nazwa u\u017cytkownika:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>')
|
||||
self.assertHTMLEqual(f.as_p(), '<p><label for="id_username">u\u017cytkownik:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>')
|
||||
|
||||
def test_regression_5216(self):
|
||||
# There was some problems with form translations in #5216
|
||||
|
|
Loading…
Reference in New Issue