add tests for the django test suite

This commit is contained in:
Maxim Kurnikov
2019-01-26 17:17:35 +03:00
parent 38e841c4c7
commit 1afa079b0b
18 changed files with 232 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
from typing import Any, Dict, Iterator, Optional, List
from django.template.base import Template
from django.template.base import Template as Template
from django.template.exceptions import TemplateDoesNotExist
from django.template.engine import Engine

View File

@@ -1,6 +1,6 @@
from typing import Callable, Dict, List, Optional, Tuple, Any
from django.template.base import Template
from django.template.base import Template as Template
from django.template.exceptions import TemplateSyntaxError
from .base import BaseEngine

View File

@@ -51,5 +51,5 @@ class Engine:
) -> Tuple[Template, Origin]: ...
def from_string(self, template_code: str) -> Template: ...
def get_template(self, template_name: str) -> Template: ...
def render_to_string(self, template_name: str, context: Any = ...) -> SafeText: ...
def render_to_string(self, template_name: str, context: Optional[Dict[str, Any]] = ...) -> SafeText: ...
def select_template(self, template_name_list: List[str]) -> Template: ...

View File

@@ -1,19 +1,12 @@
from typing import Dict, List, Optional, Union
from typing import Dict, List, Optional, Union, Any
from django.core.handlers.wsgi import WSGIRequest
from django.template.backends.django import Template as DjangoTemplate
from django.template.backends.dummy import Template as DummyTemplate
from django.template.backends.jinja2 import Template as Jinja2Template
def get_template(
template_name: str, using: Optional[str] = ...
) -> Union[DjangoTemplate, DummyTemplate, Jinja2Template]: ...
def select_template(
template_name_list: Union[List[str], str], using: Optional[str] = ...
) -> Union[DjangoTemplate, DummyTemplate, Jinja2Template]: ...
def get_template(template_name: str, using: Optional[str] = ...) -> Any: ...
def select_template(template_name_list: Union[List[str], str], using: Optional[str] = ...) -> Any: ...
def render_to_string(
template_name: Union[List[str], str],
context: Optional[Union[Dict[str, bool], Dict[str, str]]] = ...,
context: Optional[Dict[str, Any]] = ...,
request: Optional[WSGIRequest] = ...,
using: Optional[str] = ...,
) -> str: ...