MCPcopy
hub / github.com/pydantic/pydantic / test_json_serialization_email

Function test_json_serialization_email

tests/test_json.py:98–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97@pytest.mark.skipif(not email_validator, reason='email_validator not installed')
98def test_json_serialization_email():
99 config_wrapper = ConfigWrapper({'arbitrary_types_allowed': False})
100 gen = GenerateSchema(config_wrapper, None)
101 schema = gen.generate_schema(NameEmail)
102 serializer = SchemaSerializer(schema)
103 assert serializer.to_json(NameEmail('foo bar', 'foobaR@example.com')) == b'"foo bar <foobaR@example.com>"'
104
105
106@pytest.mark.skipif(sys.platform.startswith('win'), reason='paths look different on windows')

Callers

nothing calls this directly

Calls 4

generate_schemaMethod · 0.95
ConfigWrapperClass · 0.90
GenerateSchemaClass · 0.90
NameEmailClass · 0.90

Tested by

no test coverage detected