diff options
| author | Guillaume Pannatier <guillaume.pannatier@gmail.com> | 2014-05-23 09:07:15 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-28 13:23:28 -0400 |
| commit | 32586b0ba43816d325be0ce807f75623683eed7a (patch) | |
| tree | 7aee8f593e816351b9ae4be11f74105f6eb797a9 /tests | |
| parent | fd427f1fe3c563d5fe0badfec0a39d6cd43454da (diff) | |
Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget`
Thanks danielsamuels for the report
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_extra.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index f74a6a08b2..499db79014 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -297,6 +297,11 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin): <option value="2013">2013</option> </select>""") + w = SelectDateWidget(years=('2014',), empty_label='empty_label') + + # Rendering the default state with empty_label setted. + self.assertInHTML('<option value="0">empty_label</option>', w.render('mydate', ''), count=3) + a = GetDate({'mydate_month': '4', 'mydate_day': '1', 'mydate_year': '2008'}) self.assertTrue(a.is_valid()) self.assertEqual(a.cleaned_data['mydate'], datetime.date(2008, 4, 1)) |
