diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-03-02 18:01:24 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-03-02 18:11:10 +0100 |
| commit | 384c180e414a982a6cc5ccabc675bcfb4fd80988 (patch) | |
| tree | c37afdbf422603b646bb470ef433c7e8f48a3517 /tests/forms_tests | |
| parent | fe5d9fe5fec2617b9eb8564df77ba5324834cadc (diff) | |
Fixed #19917 -- Added microseconds in default TIME_INPUT_FORMATS
Thanks minddust for the report.
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/input_formats.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/forms_tests/tests/input_formats.py b/tests/forms_tests/tests/input_formats.py index 7a305dbc2b..eb0e8dcad8 100644 --- a/tests/forms_tests/tests/input_formats.py +++ b/tests/forms_tests/tests/input_formats.py @@ -9,7 +9,8 @@ from django.test import SimpleTestCase @override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True) class LocalizedTimeTests(SimpleTestCase): def setUp(self): - # nl/formats.py has customized TIME_INPUT_FORMATS + # nl/formats.py has customized TIME_INPUT_FORMATS: + # ('%H:%M:%S', '%H.%M:%S', '%H.%M', '%H:%M') activate('nl') def tearDown(self): @@ -37,6 +38,10 @@ class LocalizedTimeTests(SimpleTestCase): text = f.widget._format_value(result) self.assertEqual(text, "13:30:00") + # ISO formats are accepted, even if not specified in formats.py + result = f.clean('13:30:05.000155') + self.assertEqual(result, time(13,30,5,155)) + def test_localized_timeField(self): "Localized TimeFields act as unlocalized widgets" f = forms.TimeField(localize=True) |
