mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-14 07:47:09 +08:00
Fix BaseModelForm not working with generic type parameter (#705)
Resolves: https://github.com/typeddjango/django-stubs/issues/703
This commit is contained in:
@@ -5,6 +5,8 @@ from typing import Optional
|
||||
import pytest
|
||||
from _pytest.fixtures import FixtureRequest
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
from django.db.models import Model
|
||||
from django.forms.models import ModelForm
|
||||
from typing_extensions import Protocol
|
||||
|
||||
import django_stubs_ext
|
||||
@@ -46,6 +48,9 @@ def test_patched_generics(make_generic_classes: _MakeGenericClasses) -> None:
|
||||
if el.version is None:
|
||||
assert el.cls[type] is el.cls # `type` is arbitrary
|
||||
|
||||
class TestForm(ModelForm[Model]):
|
||||
pass
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"django_version",
|
||||
|
||||
Reference in New Issue
Block a user