Refs #29600 -- Added test for datetime_safe usage in localize_input().
This commit is contained in:
parent
76852c3989
commit
013d439ff0
|
@ -949,8 +949,15 @@ class FormattingTests(SimpleTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_localized_input_func(self):
|
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):
|
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):
|
def test_sanitize_separators(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue