From 32586b0ba43816d325be0ce807f75623683eed7a Mon Sep 17 00:00:00 2001 From: Guillaume Pannatier Date: Fri, 23 May 2014 09:07:15 +0200 Subject: Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget` Thanks danielsamuels for the report --- tests/forms_tests/tests/test_extra.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/forms_tests') 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): """) + w = SelectDateWidget(years=('2014',), empty_label='empty_label') + + # Rendering the default state with empty_label setted. + self.assertInHTML('', 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)) -- cgit v1.3