def test_generic_recursive_models_parametrized() -> None:
    """https://github.com/pydantic/pydantic/issues/10279"""

    # This test is similar (if not identical) to the previous one, although in this one,
    # we make sure we can parametrize and rebuild the models (see the linked issue).

    T = TypeVar('T')

    class Model1(BaseModel, Generic[T]):
        model2: 'Model2[T]'

    S = TypeVar('S')

    class Model2(BaseModel, Generic[S]):
        model1: Model1[S]

    Model1[str].model_rebuild()
    Model2[str].model_rebuild()
https://github.com/pydantic/pydantic/issues/10279
tests/test_generics.py