Skip to content

Commit

Permalink
Fix type hints for assertFormError and assertForSetError. Refs #1137
Browse files Browse the repository at this point in the history
  • Loading branch information
nektor211 authored and bluetech committed Sep 2, 2024
1 parent b373db6 commit b66d69a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Nicolas Delaby <[email protected]>
Hasan Ramezani <[email protected]>
Michael Howitz
Mark Gensler
Pavel Taufer
7 changes: 3 additions & 4 deletions pytest_django/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def assertion_func(*args, **kwargs):

if TYPE_CHECKING:
from django.http.response import HttpResponseBase
import django.forms as forms

def assertRedirects(
response: HttpResponseBase,
Expand Down Expand Up @@ -93,17 +94,15 @@ def assertNotContains(
...

def assertFormError(
response: HttpResponseBase,
form: str,
form: forms.BaseForm,
field: str | None,
errors: str | Sequence[str],
msg_prefix: str = ...,
) -> None:
...

def assertFormsetError(
response: HttpResponseBase,
formset: str,
formset: forms.BaseFormSet,
form_index: int | None,
field: str | None,
errors: str | Sequence[str],
Expand Down

0 comments on commit b66d69a

Please sign in to comment.