enable 6 more test folders

This commit is contained in:
Maxim Kurnikov
2019-02-06 14:29:42 +03:00
parent c534e75aaf
commit d18fc0bf5f
18 changed files with 98 additions and 102 deletions

View File

@@ -1,7 +1,8 @@
from enum import Enum
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, Type, Union
from django.template.context import Context
from django.http.request import HttpRequest
from django.template.context import Context as Context
from django.template.engine import Engine
from django.template.library import Library
from django.template.loaders.base import Loader
@@ -58,11 +59,9 @@ class Template:
engine: Optional[Engine] = ...,
) -> None: ...
def __iter__(self) -> None: ...
def render(self, context: Context) -> Any: ...
def render(self, context: Union[Context, Dict[str, Any]], request: Optional[HttpRequest] = ...) -> Any: ...
def compile_nodelist(self) -> NodeList: ...
def get_exception_info(
self, exception: Exception, token: Token
) -> Dict[str, Union[List[Tuple[int, SafeText]], int, str]]: ...
def get_exception_info(self, exception: Exception, token: Token) -> Dict[str, Any]: ...
def linebreak_iter(template_source: str) -> Iterator[int]: ...
@@ -141,7 +140,7 @@ class Variable:
translate: bool = ...
message_context: Optional[str] = ...
def __init__(self, var: Union[Dict[Any, Any], str]) -> None: ...
def resolve(self, context: Union[Dict[str, Dict[str, Union[int, str]]], Context, int, str]) -> Any: ...
def resolve(self, context: Union[Mapping[str, Mapping[str, Any]], Context, int, str]) -> Any: ...
class Node:
must_be_first: bool = ...

View File

@@ -1,11 +1,8 @@
from datetime import _date, datetime, timedelta
from decimal import Decimal
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
from datetime import date as _date, datetime, time as _time
from typing import Any, Callable, Dict, List, Optional, Union
from django.utils.safestring import SafeText
from .base import Variable as Variable, VariableDoesNotExist as VariableDoesNotExist
from .library import Library as Library
from django.utils.html import escape as escape
register: Any
@@ -14,7 +11,7 @@ def addslashes(value: str) -> str: ...
def capfirst(value: str) -> str: ...
def escapejs_filter(value: str) -> SafeText: ...
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
def floatformat(text: Optional[Union[Decimal, float, str]], arg: Union[int, str] = ...) -> str: ...
def floatformat(text: Optional[Any], arg: Union[int, str] = ...) -> str: ...
def iriencode(value: str) -> str: ...
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
def lower(value: str) -> str: ...
@@ -43,41 +40,20 @@ def linebreaksbr(value: str, autoescape: bool = ...) -> SafeText: ...
def safe(value: str) -> SafeText: ...
def safeseq(value: List[str]) -> List[SafeText]: ...
def striptags(value: str) -> str: ...
def dictsort(
value: Union[
Dict[str, int],
List[Dict[str, Dict[str, Union[int, str]]]],
List[Dict[str, str]],
List[Tuple[str, str]],
List[int],
int,
str,
],
arg: Union[int, str],
) -> Union[List[Dict[str, Dict[str, Union[int, str]]]], List[Dict[str, str]], List[Tuple[str, str]], str]: ...
def dictsortreversed(
value: Union[Dict[str, int], List[Dict[str, Union[int, str]]], List[Tuple[str, str]], List[int], int, str],
arg: Union[int, str],
) -> Union[List[Dict[str, Union[int, str]]], List[Tuple[str, str]], str]: ...
def first(value: Union[List[int], List[str], str]) -> Union[int, str]: ...
def dictsort(value: Any, arg: Union[int, str]) -> Any: ...
def dictsortreversed(value: Any, arg: Union[int, str]) -> Any: ...
def first(value: Any) -> Any: ...
def join(value: Any, arg: str, autoescape: bool = ...) -> Any: ...
def last(value: List[str]) -> str: ...
def length(value: Any) -> int: ...
def length_is(
value: Optional[Union[List[Callable], Tuple[str, str], int, str]], arg: Union[SafeText, int]
) -> Union[bool, str]: ...
def length_is(value: Optional[Any], arg: Union[SafeText, int]) -> Union[bool, str]: ...
def random(value: List[str]) -> str: ...
def slice_filter(value: Any, arg: str) -> Any: ...
def unordered_list(
value: Union[Iterator[Any], List[Union[List[Union[List[Union[List[str], str]], str]], str]]], autoescape: bool = ...
) -> SafeText: ...
def add(
value: Union[List[int], Tuple[int, int], _date, int, str],
arg: Union[List[int], Tuple[int, int], timedelta, int, str],
) -> Union[List[int], Tuple[int, int, int, int], _date, int, str]: ...
def get_digit(value: Union[int, str], arg: int) -> Union[int, str]: ...
def unordered_list(value: Any, autoescape: bool = ...) -> Any: ...
def add(value: Any, arg: Any) -> Any: ...
def get_digit(value: Any, arg: int) -> Any: ...
def date(value: Optional[Union[_date, datetime, str]], arg: Optional[str] = ...) -> str: ...
def time(value: Optional[Union[datetime, str]], arg: Optional[str] = ...) -> str: ...
def time(value: Optional[Union[datetime, _time, str]], arg: Optional[str] = ...) -> str: ...
def timesince_filter(value: Optional[_date], arg: Optional[_date] = ...) -> str: ...
def timeuntil_filter(value: Optional[_date], arg: Optional[_date] = ...) -> str: ...
def default(value: Optional[Union[int, str]], arg: Union[int, str]) -> Union[int, str]: ...

View File

@@ -1,9 +1,9 @@
from collections import namedtuple
from datetime import date
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
from django.template.base import FilterExpression, Parser, Token
from django.template.context import RequestContext, Context
from django.template.context import Context
from django.utils.safestring import SafeText
from .base import Node, NodeList
@@ -153,9 +153,13 @@ class WidthRatioNode(Node):
class WithNode(Node):
nodelist: NodeList = ...
extra_context: Dict[str, Union[FilterExpression, str]] = ...
extra_context: Dict[str, Any] = ...
def __init__(
self, var: Optional[str], name: Optional[str], nodelist: NodeList, extra_context: Optional[Dict[str, Any]] = ...
self,
var: Optional[str],
name: Optional[str],
nodelist: Union[NodeList, Sequence[Node]],
extra_context: Optional[Dict[str, Any]] = ...,
) -> None: ...
def autoescape(parser: Parser, token: Token) -> AutoEscapeControlNode: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence
from django.template.base import Origin
from django.template.library import Library
@@ -7,6 +7,8 @@ from django.utils.safestring import SafeText
from .base import Template
_Loader = Any
class Engine:
template_context_processors: Tuple[Callable]
template_loaders: List[Loader]
@@ -16,7 +18,7 @@ class Engine:
autoescape: bool = ...
context_processors: Union[List[str], Tuple[str]] = ...
debug: bool = ...
loaders: Union[List[List[Union[Dict[str, str], str]]], List[Tuple[str, List[str]]], List[str]] = ...
loaders: Sequence[_Loader] = ...
string_if_invalid: str = ...
file_charset: str = ...
libraries: Dict[str, str] = ...
@@ -29,7 +31,7 @@ class Engine:
app_dirs: bool = ...,
context_processors: Optional[Union[List[str], Tuple[str]]] = ...,
debug: bool = ...,
loaders: Optional[Union[List[List[Union[Dict[str, str], str]]], List[Tuple[str, List[str]]], List[str]]] = ...,
loaders: Optional[Sequence[_Loader]] = ...,
string_if_invalid: str = ...,
file_charset: str = ...,
libraries: Optional[Dict[str, str]] = ...,
@@ -40,12 +42,8 @@ class Engine:
def get_default() -> Engine: ...
def get_template_builtins(self, builtins: List[str]) -> List[Library]: ...
def get_template_libraries(self, libraries: Dict[str, str]) -> Dict[str, Library]: ...
def get_template_loaders(
self, template_loaders: Union[List[List[Union[Dict[str, str], str]]], List[Tuple[str, List[str]]], List[str]]
) -> List[Loader]: ...
def find_template_loader(
self, loader: Union[List[Union[Dict[str, str], str]], Tuple[str, List[str]], str]
) -> Loader: ...
def get_template_loaders(self, template_loaders: Sequence[_Loader]) -> List[Loader]: ...
def find_template_loader(self, loader: _Loader) -> Loader: ...
def find_template(
self, name: str, dirs: None = ..., skip: Optional[List[Origin]] = ...
) -> Tuple[Template, Origin]: ...

View File

@@ -1,10 +1,11 @@
from typing import Any, List, Optional
from typing import Any, List, Optional, Dict
from django.template.base import Origin, Template
from django.template.engine import Engine
class Loader:
engine: Any = ...
get_template_cache: Dict[str, Any] = ...
def __init__(self, engine: Engine) -> None: ...
def get_template(self, template_name: str, skip: Optional[List[Origin]] = ...) -> Template: ...
def get_template_sources(self, template_name: Any) -> None: ...