def test_order_preserved() -> None:
    """https://github.com/pydantic/pydantic/issues/2398"""

    @dataclasses.dataclass(order=True)
    class DC:
        num: int = 42

    class Model(pydantic.BaseModel):
        dc: DC

    real_dc = DC()
    model = Model(dc=real_dc)

    # This works as expected.
    assert real_dc <= real_dc
    assert model.dc <= model.dc
    assert real_dc <= model.dc
https://github.com/pydantic/pydantic/issues/2398
tests/test_dataclasses.py