Fix BaseModelForm not working with generic type parameter (#705)

Resolves: https://github.com/typeddjango/django-stubs/issues/703
This commit is contained in:
Eero Ruohola
2021-09-07 22:07:22 +03:00
committed by GitHub
parent b6d3373c34
commit 6424e33a74
2 changed files with 7 additions and 0 deletions

View File

@@ -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",