sort out all test folders into passable and TODOs

This commit is contained in:
Maxim Kurnikov
2019-01-30 22:43:09 +03:00
parent b1153204d7
commit c9e8fe53a5
20 changed files with 819 additions and 49 deletions

View File

@@ -21,7 +21,7 @@ class BaseCache:
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
def make_key(self, key: Union[int, str], version: Optional[Union[int, str]] = ...) -> str: ...
def add(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def get(self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...) -> None: ...
def get(self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...) -> Any: ...
def set(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def touch(self, key: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Dict, List, Optional, Union, Iterable, Sequence
from typing import Dict, List, Optional, Union, Iterable, Sequence, Protocol, Any
from django.db.models.base import Model
from django.db.models.query import QuerySet
@@ -8,13 +8,23 @@ class InvalidPage(Exception): ...
class PageNotAnInteger(InvalidPage): ...
class EmptyPage(InvalidPage): ...
class SupportsLen(Protocol):
def __len__(self) -> int: ...
class SupportsCount(Protocol):
def count(self) -> int: ...
class Paginator:
object_list: QuerySet = ...
per_page: int = ...
orphans: int = ...
allow_empty_first_page: bool = ...
def __init__(
self, object_list: Iterable, per_page: Union[int, str], orphans: int = ..., allow_empty_first_page: bool = ...
self,
object_list: Union[SupportsLen, SupportsCount],
per_page: Union[int, str],
orphans: int = ...,
allow_empty_first_page: bool = ...,
) -> None: ...
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
def get_page(self, number: Optional[int]) -> Page: ...

View File

@@ -2,10 +2,18 @@ from collections import OrderedDict
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
from django.apps.config import AppConfig
from django.core.serializers.base import Serializer, Deserializer
from django.db.models.base import Model
from django.db.models.query import QuerySet
from .base import (
Serializer as Serializer,
Deserializer as Deserializer,
SerializerDoesNotExist as SerializerDoesNotExist,
SerializationError as SerializationError,
DeserializationError as DeserializationError,
M2MDeserializationError as M2MDeserializationError,
)
BUILTIN_SERIALIZERS: Any
class BadSerializer: