Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add different signatures for form assertions from Django 4.1 #1105

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions django-stubs/test/testcases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ from django.db import connections as connections # noqa: F401
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.base import Model
from django.db.models.query import QuerySet, RawQuerySet
from django.forms import BaseFormSet, Form
from django.forms.fields import EmailField
from django.http.response import FileResponse, HttpResponseBase
from django.template.base import Template
Expand Down Expand Up @@ -105,6 +106,15 @@ class SimpleTestCase(unittest.TestCase):
msg_prefix: str = ...,
html: bool = ...,
) -> None: ...
@overload
def assertFormError(
self,
form: Form,
field: Optional[str],
errors: Union[List[str], str],
msg_prefix: str = ...,
) -> None: ...
@overload
def assertFormError(
self,
response: HttpResponseBase,
Expand All @@ -113,6 +123,16 @@ class SimpleTestCase(unittest.TestCase):
errors: Union[List[str], str],
msg_prefix: str = ...,
) -> None: ...
@overload
def assertFormsetError(
self,
formset: BaseFormSet,
form_index: Optional[int],
field: Optional[str],
errors: Union[List[str], str],
msg_prefix: str = ...,
) -> None: ...
@overload
def assertFormsetError(
self,
response: HttpResponseBase,
Expand Down