def test_constraints_on_str_like() -> None:
    """See https://github.com/pydantic/pydantic/issues/8577 for motivation."""

    class Foo(BaseModel):
        baz: Annotated[EmailStr, StringConstraints(to_lower=True, strip_whitespace=True)]

    assert Foo(baz=' uSeR@ExAmPlE.com  ').baz == 'user@example.com'
See https://github.com/pydantic/pydantic/issues/8577 for motivation.
tests/test_types.py