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

This commit is contained in:
Tim Graham 2018-07-26 16:38:08 -04:00
parent 76852c3989
commit 013d439ff0
1 changed files with 8 additions and 1 deletions

View File

@ -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):
"""