Skip to content

Commit 9440956

Browse files
committed
Fix test name and avoid deprecation warnings
1 parent 68b31d7 commit 9440956

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_aliases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_dict_default_uses_field_names(
8383
model: Union[Type[PydanticUser], Type[SQLModelUser]],
8484
):
8585
user = model(fullName="Dana")
86-
if VERSION.startswith("2."):
86+
if VERSION.startswith("2.") or isinstance(user, SQLModel):
8787
data = user.model_dump()
8888
else:
8989
data = user.dict()
@@ -93,11 +93,11 @@ def test_dict_default_uses_field_names(
9393

9494

9595
@pytest.mark.parametrize("model", [PydanticUser, SQLModelUser])
96-
def test_dict_default_uses_aliases(
96+
def test_dict_by_alias_uses_aliases(
9797
model: Union[Type[PydanticUser], Type[SQLModelUser]],
9898
):
9999
user = model(fullName="Dana")
100-
if VERSION.startswith("2."):
100+
if VERSION.startswith("2.") or isinstance(user, SQLModel):
101101
data = user.model_dump(by_alias=True)
102102
else:
103103
data = user.dict(by_alias=True)

0 commit comments

Comments
 (0)