File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments