diff options
| author | Tim Graham <timograham@gmail.com> | 2018-07-26 16:38:08 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-07-26 16:51:50 -0400 |
| commit | 013d439ff038ca8e750e6d1dcd6965f33ad4cf3e (patch) | |
| tree | 3325fa1a99945f76d27c410a54f50b955a0da660 | |
| parent | 76852c398943cf8a3b7a517f05614df3e47970c8 (diff) | |
Refs #29600 -- Added test for datetime_safe usage in localize_input().
| -rw-r--r-- | tests/i18n/tests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index 9a159ff55a..5d76e26653 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -949,8 +949,15 @@ class FormattingTests(SimpleTestCase): ) def test_localized_input_func(self): + tests = ( + (True, 'True'), + (datetime.date(1, 1, 1), '0001-01-01'), + (datetime.datetime(1, 1, 1), '0001-01-01 00:00:00'), + ) with self.settings(USE_THOUSAND_SEPARATOR=True): - self.assertEqual(localize_input(True), 'True') + for value, expected in tests: + with self.subTest(value=value): + self.assertEqual(localize_input(value), expected) def test_sanitize_separators(self): """ |
