@@ -40,10 +40,10 @@ def assertion_func(*args, **kwargs):
40
40
41
41
42
42
if TYPE_CHECKING :
43
- from django .http import HttpResponse
43
+ from django .http . response import HttpResponseBase
44
44
45
45
def assertRedirects (
46
- response : HttpResponse ,
46
+ response : HttpResponseBase ,
47
47
expected_url : str ,
48
48
status_code : int = ...,
49
49
target_status_code : int = ...,
@@ -60,7 +60,7 @@ def assertURLEqual(
60
60
...
61
61
62
62
def assertContains (
63
- response : HttpResponse ,
63
+ response : HttpResponseBase ,
64
64
text : object ,
65
65
count : Optional [int ] = ...,
66
66
status_code : int = ...,
@@ -70,7 +70,7 @@ def assertContains(
70
70
...
71
71
72
72
def assertNotContains (
73
- response : HttpResponse ,
73
+ response : HttpResponseBase ,
74
74
text : object ,
75
75
status_code : int = ...,
76
76
msg_prefix : str = ...,
@@ -79,7 +79,7 @@ def assertNotContains(
79
79
...
80
80
81
81
def assertFormError (
82
- response : HttpResponse ,
82
+ response : HttpResponseBase ,
83
83
form : str ,
84
84
field : Optional [str ],
85
85
errors : Union [str , Sequence [str ]],
@@ -88,7 +88,7 @@ def assertFormError(
88
88
...
89
89
90
90
def assertFormsetError (
91
- response : HttpResponse ,
91
+ response : HttpResponseBase ,
92
92
formset : str ,
93
93
form_index : Optional [int ],
94
94
field : Optional [str ],
@@ -98,15 +98,15 @@ def assertFormsetError(
98
98
...
99
99
100
100
def assertTemplateUsed (
101
- response : Optional [HttpResponse ] = ...,
101
+ response : Optional [Union [ HttpResponseBase , str ] ] = ...,
102
102
template_name : Optional [str ] = ...,
103
103
msg_prefix : str = ...,
104
104
count : Optional [int ] = ...,
105
105
):
106
106
...
107
107
108
108
def assertTemplateNotUsed (
109
- response : Optional [HttpResponse ] = ...,
109
+ response : Optional [Union [ HttpResponseBase , str ] ] = ...,
110
110
template_name : Optional [str ] = ...,
111
111
msg_prefix : str = ...,
112
112
):
0 commit comments