MCPcopy
hub / github.com/pydantic/pydantic / test_datetime_json

Function test_datetime_json

pydantic-core/tests/serializers/test_datetime.py:61–64  ·  view source on GitHub ↗
(value, expected)

Source from the content-addressed store, hash-verified

59 ],
60)
61def test_datetime_json(value, expected):
62 v = SchemaSerializer(core_schema.datetime_schema())
63 assert v.to_python(value, mode='json') == expected
64 assert v.to_json(value).decode() == f'"{expected}"'
65
66
67def test_date():

Callers

nothing calls this directly

Calls 2

datetime_schemaMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected