MCPcopy Index your code
hub / github.com/fastapi/sqlmodel / test_serialize_with_serialization_alias

Function test_serialize_with_serialization_alias

tests/test_aliases.py:113–121  ·  view source on GitHub ↗
(
    model: type[PydanticUserV2] | type[SQLModelUserV2],
)

Source from the content-addressed store, hash-verified

111
112@pytest.mark.parametrize("model", [PydanticUserV2, SQLModelUserV2])
113def test_serialize_with_serialization_alias(
114 model: type[PydanticUserV2] | type[SQLModelUserV2],
115):
116 user = model(firstName="Jane")
117 data = user.model_dump(by_alias=True)
118 assert "f_name" in data
119 assert "firstName" not in data
120 assert "first_name" not in data
121 assert data["f_name"] == "Jane"
122
123
124def test_schema_extra_validation_alias_sqlmodel_v2():

Callers

nothing calls this directly

Calls 1

model_dumpMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…