Skip to content

Commit

Permalink
Fix assert function signatures that expect HTTP response (#1036)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Schoettle <matthias.schoettle@muhc.mcgill.ca>
  • Loading branch information
mschoettle and Matthias Schoettle committed Nov 8, 2022
1 parent 1f3708a commit 42b7db2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pytest_django/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def assertion_func(*args, **kwargs):


if TYPE_CHECKING:
from django.http import HttpResponse
from django.http.response import HttpResponseBase

def assertRedirects(
response: HttpResponse,
response: HttpResponseBase,
expected_url: str,
status_code: int = ...,
target_status_code: int = ...,
Expand All @@ -60,7 +60,7 @@ def assertURLEqual(
...

def assertContains(
response: HttpResponse,
response: HttpResponseBase,
text: object,
count: Optional[int] = ...,
status_code: int = ...,
Expand All @@ -70,7 +70,7 @@ def assertContains(
...

def assertNotContains(
response: HttpResponse,
response: HttpResponseBase,
text: object,
status_code: int = ...,
msg_prefix: str = ...,
Expand All @@ -79,7 +79,7 @@ def assertNotContains(
...

def assertFormError(
response: HttpResponse,
response: HttpResponseBase,
form: str,
field: Optional[str],
errors: Union[str, Sequence[str]],
Expand All @@ -88,7 +88,7 @@ def assertFormError(
...

def assertFormsetError(
response: HttpResponse,
response: HttpResponseBase,
formset: str,
form_index: Optional[int],
field: Optional[str],
Expand All @@ -98,15 +98,15 @@ def assertFormsetError(
...

def assertTemplateUsed(
response: Optional[HttpResponse] = ...,
response: Optional[Union[HttpResponseBase, str]] = ...,
template_name: Optional[str] = ...,
msg_prefix: str = ...,
count: Optional[int] = ...,
):
...

def assertTemplateNotUsed(
response: Optional[HttpResponse] = ...,
response: Optional[Union[HttpResponseBase, str]] = ...,
template_name: Optional[str] = ...,
msg_prefix: str = ...,
):
Expand Down

0 comments on commit 42b7db2

Please sign in to comment.