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

@@ -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: ...