diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 5b50f37..8c1e20b 100644
a
|
b
|
class NullBooleanSelect(Select):
|
552 | 552 | A Select Widget intended to be used with NullBooleanField. |
553 | 553 | """ |
554 | 554 | def __init__(self, attrs=None): |
555 | | choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No'))) |
| 555 | choices = ((u'1', ugettext_lazy('Unknown')), |
| 556 | (u'2', ugettext_lazy('Yes')), |
| 557 | (u'3', ugettext_lazy('No'))) |
556 | 558 | super(NullBooleanSelect, self).__init__(attrs, choices) |
557 | 559 | |
558 | 560 | def render(self, name, value, attrs=None, choices=()): |
diff --git a/tests/regressiontests/forms/tests/widgets.py b/tests/regressiontests/forms/tests/widgets.py
index 2424bea..a1d98e9 100644
a
|
b
|
beatle J R Ringo False""")
|
984 | 984 | self.assertEqual(w.render('date', datetime.datetime(2007, 9, 17, 12, 51)), u'<input type="hidden" name="date_0" value="2007-09-17" /><input type="hidden" name="date_1" value="12:51:00" />') |
985 | 985 | |
986 | 986 | |
| 987 | class NullSelectNotLazyForm(Form): |
| 988 | """Form to test for lazy evaluation #17190""" |
| 989 | name = CharField(widget=NullBooleanSelect()) |
| 990 | |
| 991 | |
987 | 992 | class FormsI18NWidgetsTestCase(TestCase): |
988 | 993 | def setUp(self): |
989 | 994 | super(FormsI18NWidgetsTestCase, self).setUp() |
… |
… |
class FormsI18NWidgetsTestCase(TestCase):
|
1025 | 1030 | w.is_localized = True |
1026 | 1031 | self.assertEqual(w.render('date', datetime.datetime(2007, 9, 17, 12, 51)), u'<input type="hidden" name="date_0" value="17.09.2007" /><input type="hidden" name="date_1" value="12:51:00" />') |
1027 | 1032 | |
| 1033 | def test_nullbooleanselect(self): |
| 1034 | """test for lazy evaluation #17190""" |
| 1035 | f = NullSelectNotLazyForm() |
| 1036 | self.assertEqual(f.as_table(), u'<tr><th><label for="id_name">Name:</label></th><td><select name="name" id="id_name">\n<option value="1" selected="selected">Unbekannt</option>\n<option value="2">Ja</option>\n<option value="3">Nein</option>\n</select></td></tr>') |
| 1037 | |
1028 | 1038 | |
1029 | 1039 | class SelectAndTextWidget(MultiWidget): |
1030 | 1040 | """ |