Kaydet (Commit) 76852c39 authored tarafından Tim Graham's avatar Tim Graham

Refs #29600 -- Added test for datetime_safe usage in SelectDateWidget.value_from_datadict().

üst 2ac7cd52
......@@ -477,6 +477,12 @@ class SelectDateWidgetTest(WidgetTest):
w.value_from_datadict({'date_year': '1899', 'date_month': '8', 'date_day': '13'}, {}, 'date'),
'13-08-1899',
)
# And years before 1000 (demonstrating the need for datetime_safe).
w = SelectDateWidget(years=('0001',))
self.assertEqual(
w.value_from_datadict({'date_year': '0001', 'date_month': '8', 'date_day': '13'}, {}, 'date'),
'13-08-0001',
)
def test_format_value(self):
valid_formats = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment