File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/models-library/tests Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ class ModelWithPreValidator(BaseModel):
2626
2727 # with Enum1
2828 model = Model (color = Enum1 .RED )
29- assert ModelWithPreValidator (color = Enum1 .RED ) == model
29+ # See: https://docs.pydantic.dev/latest/migration/#changes-to-pydanticbasemodel
30+ assert ModelWithPreValidator (color = Enum1 .RED ).model_dump () == model .model_dump ()
3031
3132 # with Enum2
3233 class Enum2 (Enum ):
@@ -35,7 +36,8 @@ class Enum2(Enum):
3536 with pytest .raises (ValidationError ):
3637 Model (color = Enum2 .RED )
3738
38- assert ModelWithPreValidator (color = Enum2 .RED ) == model
39+ # See: https://docs.pydantic.dev/latest/migration/#changes-to-pydanticbasemodel
40+ assert ModelWithPreValidator (color = Enum2 .RED ).model_dump () == model .model_dump ()
3941
4042
4143def test_empty_str_to_none_pre_validator ():
You can’t perform that action at this time.
0 commit comments