I think nowadays if unittest.TestCase is used, we could use assertDictEqual() to compare pydantic models (which can be turned into dict):
class TestPydanticModels(unittest.TestCase):
def test_models_equal(self):
self.assertDictEqual(
model1.model_dump(),
model2.model_dump()
)