Skip to content

Commit 2b1bed3

Browse files
committed
Fix type hints for assertFormError and assertForSetError. Refs #1137
1 parent 5598264 commit 2b1bed3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ Nicolas Delaby <ticosax@free.fr>
2020
Hasan Ramezani <hasan.r67@gmail.com>
2121
Michael Howitz
2222
Mark Gensler
23+
Pavel Taufer

pytest_django/asserts.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def assertion_func(*args, **kwargs):
5555

5656
if TYPE_CHECKING:
5757
from django.http.response import HttpResponseBase
58+
import django.forms as forms
5859

5960
def assertRedirects(
6061
response: HttpResponseBase,
@@ -93,17 +94,15 @@ def assertNotContains(
9394
...
9495

9596
def assertFormError(
96-
response: HttpResponseBase,
97-
form: str,
97+
form: forms.BaseForm,
9898
field: str | None,
9999
errors: str | Sequence[str],
100100
msg_prefix: str = ...,
101101
) -> None:
102102
...
103103

104104
def assertFormsetError(
105-
response: HttpResponseBase,
106-
formset: str,
105+
formset: forms.BaseFormSet,
107106
form_index: int | None,
108107
field: str | None,
109108
errors: str | Sequence[str],

0 commit comments

Comments
 (0)