Refs -- Added test for datetime_safe usage in localize_input().
@@ -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):
"""
