|
9 | 9 | reveal_type(response.client) # N: Revealed type is "django.test.client.Client"
|
10 | 10 | reveal_type(response.context) # N: Revealed type is "Union[django.test.utils.ContextList, builtins.dict[builtins.str, Any]]"
|
11 | 11 | reveal_type(response.content) # N: Revealed type is "builtins.bytes"
|
12 |
| - response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
13 | 12 | response.json()
|
14 |
| - redirected_response = client.get('foo', follow=True) |
15 |
| - reveal_type(redirected_response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
16 | 13 | - case: async_client_methods
|
17 | 14 | main: |
|
18 | 15 | from django.test.client import AsyncClient
|
|
37 | 34 | async_factory = AsyncRequestFactory()
|
38 | 35 | async_request = async_factory.get('foo')
|
39 | 36 | reveal_type(async_request) # N: Revealed type is "django.core.handlers.asgi.ASGIRequest"
|
| 37 | +- case: client_follow_flag |
| 38 | + main: | |
| 39 | + from django.test.client import Client |
| 40 | + client = Client() |
| 41 | + response = client.get('foo') |
| 42 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 43 | + response = client.get('foo', follow=False) |
| 44 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 45 | + response = client.get('foo', follow=True) |
| 46 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 47 | + x: bool |
| 48 | + response = client.get('foo', follow=x) |
| 49 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 50 | +
|
| 51 | + response = client.post('foo') |
| 52 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 53 | + response = client.post('foo', follow=False) |
| 54 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 55 | + response = client.post('foo', follow=True) |
| 56 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 57 | + x: bool |
| 58 | + response = client.post('foo', follow=x) |
| 59 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 60 | +
|
| 61 | + response = client.head('foo') |
| 62 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 63 | + response = client.head('foo', follow=False) |
| 64 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 65 | + response = client.head('foo', follow=True) |
| 66 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 67 | + x: bool |
| 68 | + response = client.head('foo', follow=x) |
| 69 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 70 | +
|
| 71 | + response = client.trace('foo') |
| 72 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 73 | + response = client.trace('foo', follow=False) |
| 74 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 75 | + response = client.trace('foo', follow=True) |
| 76 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 77 | + x: bool |
| 78 | + response = client.trace('foo', follow=x) |
| 79 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 80 | +
|
| 81 | + response = client.put('foo') |
| 82 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 83 | + response = client.put('foo', follow=False) |
| 84 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 85 | + response = client.put('foo', follow=True) |
| 86 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 87 | + x: bool |
| 88 | + response = client.put('foo', follow=x) |
| 89 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 90 | +
|
| 91 | + response = client.patch('foo') |
| 92 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 93 | + response = client.patch('foo', follow=False) |
| 94 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 95 | + response = client.patch('foo', follow=True) |
| 96 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 97 | + x: bool |
| 98 | + response = client.patch('foo', follow=x) |
| 99 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 100 | +
|
| 101 | + response = client.delete('foo') |
| 102 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 103 | + response = client.delete('foo', follow=False) |
| 104 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
| 105 | + response = client.delete('foo', follow=True) |
| 106 | + reveal_type(response.redirect_chain) # N: Revealed type is "builtins.list[Tuple[builtins.str, builtins.int]]" |
| 107 | + x: bool |
| 108 | + response = client.delete('foo', follow=x) |
| 109 | + response.redirect_chain # E: "_MonkeyPatchedWSGIResponse" has no attribute "redirect_chain" |
0 commit comments