fix '{…!j}' for otherwise non-serializable types (##2624)

like 'datetime'
This commit is contained in:
Mike Fährmann
2022-06-07 17:47:07 +02:00
parent 7fe1f4489e
commit 42525cfe8d
2 changed files with 3 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ class TestFormatter(unittest.TestCase):
self._run_test("{t!d:%Y-%m-%d}", "2010-01-01")
self._run_test("{dt!T}", "1262304000")
self._run_test("{l!j}", '["a", "b", "c"]')
self._run_test("{dt!j}", '"2010-01-01 00:00:00"')
with self.assertRaises(KeyError):
self._run_test("{a!q}", "hello world")