Skip to content

Commit a4a47e6

Browse files
authored
change assertFormError form arg type to BaseForm (#2705)
Changes the arg type for `django.test.SimpleTestCase.assertFormError` from `django.forms.Form` to `django.forms.BaseForm`. Allows instances of other form classes that are not subclasses of `Form` to be used without raising type errors, e.g. `ModelForm`.
1 parent 7a7bc1d commit a4a47e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django-stubs/test/testcases.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ from django.db import connections as connections
1212
from django.db.backends.base.base import BaseDatabaseWrapper
1313
from django.db.models.base import Model
1414
from django.db.models.query import QuerySet, RawQuerySet
15-
from django.forms import BaseFormSet, Form
15+
from django.forms import BaseForm, BaseFormSet
1616
from django.forms.fields import EmailField
1717
from django.http import HttpRequest
1818
from django.http.response import FileResponse, HttpResponseBase
@@ -101,7 +101,7 @@ class SimpleTestCase(unittest.TestCase):
101101
) -> None: ...
102102
def assertFormError(
103103
self,
104-
form: Form,
104+
form: BaseForm,
105105
field: str | None,
106106
errors: list[str] | str,
107107
msg_prefix: str = ...,

0 commit comments

Comments
 (0)