diff options
| author | Tim Graham <timograham@gmail.com> | 2017-07-03 10:16:48 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-07-06 07:41:57 -0400 |
| commit | 81febf4defe6f6da2dea80f24082b282b8bf30ca (patch) | |
| tree | baf5190d071fef472e54d6c7e2f105de202c5de6 /tests | |
| parent | 72026fff3963973d607bf0b525a082d20f024406 (diff) | |
[1.11.x] Fixed #28355 -- Fixed widget rendering of non-ASCII date/time formats on Python 2.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_timeinput.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/forms_tests/widget_tests/test_timeinput.py b/tests/forms_tests/widget_tests/test_timeinput.py index 96fb04e24c..1b63eeddc0 100644 --- a/tests/forms_tests/widget_tests/test_timeinput.py +++ b/tests/forms_tests/widget_tests/test_timeinput.py @@ -1,4 +1,9 @@ +# -*- encoding: utf-8 -*- +from __future__ import unicode_literals + +import sys from datetime import time +from unittest import skipIf from django.forms import TimeInput from django.test import override_settings @@ -43,6 +48,12 @@ class TimeInputTest(WidgetTest): widget = TimeInput(format='%H:%M', attrs={'type': 'time'}) self.check_html(widget, 'time', t, html='<input type="time" name="time" value="12:51" />') + # Test fails on Windows due to http://bugs.python.org/issue8304#msg222667 + @skipIf(sys.platform.startswith('win'), 'Fails with UnicodeEncodeError error on Windows.') + def test_non_ascii_format(self): + widget = TimeInput(format='τ-%H:%M') + self.check_html(widget, 'time', time(10, 10), '<input type="text" name="time" value="\u03c4-10:10" />') + @override_settings(USE_L10N=True) @translation.override('de-at') def test_l10n(self): |
