mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-17 17:35:59 +08:00
enable 6 more test folders
This commit is contained in:
@@ -3,7 +3,8 @@ from io import BytesIO
|
||||
from typing import Any, Dict
|
||||
from wsgiref import simple_server
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.handlers.wsgi import WSGIRequest, WSGIHandler
|
||||
from django.core.wsgi import get_wsgi_application as get_wsgi_application
|
||||
|
||||
class WSGIServer(simple_server.WSGIServer):
|
||||
request_queue_size: int = ...
|
||||
@@ -31,3 +32,5 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler):
|
||||
requestline: str = ...
|
||||
request_version: str = ...
|
||||
def handle(self) -> None: ...
|
||||
|
||||
def get_internal_wsgi_application() -> WSGIHandler: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Optional, Type, Union, Protocol
|
||||
|
||||
from django.contrib.sessions.serializers import PickleSerializer
|
||||
|
||||
@@ -11,38 +11,30 @@ def b64_decode(s: bytes) -> bytes: ...
|
||||
def base64_hmac(salt: str, value: Union[bytes, str], key: Union[bytes, str]) -> str: ...
|
||||
def get_cookie_signer(salt: str = ...) -> TimestampSigner: ...
|
||||
|
||||
class Serializer(Protocol):
|
||||
def dumps(self, obj: Any) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Any: ...
|
||||
|
||||
class JSONSerializer:
|
||||
def dumps(self, obj: Union[Dict[str, Union[int, str]], List[str], str]) -> bytes: ...
|
||||
def dumps(self, obj: Any) -> bytes: ...
|
||||
def loads(self, data: bytes) -> Dict[str, Union[int, str]]: ...
|
||||
|
||||
def dumps(
|
||||
obj: Union[Dict[str, Union[datetime, str]], List[str], str],
|
||||
key: None = ...,
|
||||
salt: str = ...,
|
||||
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
|
||||
compress: bool = ...,
|
||||
obj: Any, key: None = ..., salt: str = ..., serializer: Type[Serializer] = ..., compress: bool = ...
|
||||
) -> str: ...
|
||||
def loads(
|
||||
s: str,
|
||||
key: None = ...,
|
||||
salt: str = ...,
|
||||
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
|
||||
max_age: Optional[int] = ...,
|
||||
) -> Union[Dict[str, Union[datetime, str]], Dict[str, Union[int, str]], List[str], str]: ...
|
||||
s: str, key: None = ..., salt: str = ..., serializer: Type[Serializer] = ..., max_age: Optional[int] = ...
|
||||
) -> Any: ...
|
||||
|
||||
class Signer:
|
||||
key: str = ...
|
||||
sep: str = ...
|
||||
salt: Any = ...
|
||||
salt: str = ...
|
||||
def __init__(self, key: Optional[Union[bytes, str]] = ..., sep: str = ..., salt: Optional[str] = ...) -> None: ...
|
||||
def signature(self, value: Union[bytes, str]) -> str: ...
|
||||
def sign(self, value: str) -> str: ...
|
||||
def unsign(self, signed_value: str) -> str: ...
|
||||
|
||||
class TimestampSigner(Signer):
|
||||
key: str
|
||||
salt: str
|
||||
sep: str
|
||||
def timestamp(self) -> str: ...
|
||||
def sign(self, value: str) -> str: ...
|
||||
def unsign(self, value: str, max_age: Optional[int] = ...) -> str: ...
|
||||
def unsign(self, value: str, max_age: Optional[Union[int, timedelta]] = ...) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user