mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-03-05 06:34:16 +08:00
Add type hints to all test code (#1217)
* Add type hints to all test code * Fixes * Fix indentation * Review fixes
This commit is contained in:
@@ -14,22 +14,24 @@
|
||||
|
||||
- case: dispatch_http_response
|
||||
main: |
|
||||
from django.http import HttpResponse
|
||||
from typing import Any
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.views.generic.base import View
|
||||
|
||||
class MyView(View):
|
||||
def dispatch(self, request, *args, **kwargs) -> HttpResponse:
|
||||
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
|
||||
response: HttpResponse
|
||||
return response
|
||||
|
||||
|
||||
- case: dispatch_streaming_http_response
|
||||
main: |
|
||||
from django.http import StreamingHttpResponse
|
||||
from typing import Any
|
||||
from django.http import HttpRequest, StreamingHttpResponse
|
||||
from django.views.generic.base import View
|
||||
|
||||
class MyView(View):
|
||||
def dispatch(self, request, *args, **kwargs) -> StreamingHttpResponse:
|
||||
def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> StreamingHttpResponse:
|
||||
response: StreamingHttpResponse
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user