mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 14:01:56 +08:00
initial commit
This commit is contained in:
232
django/test/client.pyi
Normal file
232
django/test/client.pyi
Normal file
@@ -0,0 +1,232 @@
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.sessions.backends.base import SessionBase
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.dispatch.dispatcher import Signal
|
||||
from django.http.request import (
|
||||
HttpRequest,
|
||||
QueryDict,
|
||||
)
|
||||
from django.http.response import (
|
||||
FileResponse,
|
||||
HttpResponse,
|
||||
HttpResponseBase,
|
||||
HttpResponseForbidden,
|
||||
HttpResponseRedirect,
|
||||
)
|
||||
from django.template.base import Template
|
||||
from django.template.context import Context
|
||||
from django.test.utils import ContextList
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
from urllib.parse import ParseResult
|
||||
|
||||
|
||||
def closing_iterator_wrapper(iterable: map, close: Callable) -> None: ...
|
||||
|
||||
|
||||
def conditional_content_removal(
|
||||
request: HttpRequest,
|
||||
response: HttpResponseBase
|
||||
) -> HttpResponseBase: ...
|
||||
|
||||
|
||||
def encode_file(boundary: str, key: str, file: Any) -> List[bytes]: ...
|
||||
|
||||
|
||||
def encode_multipart(boundary: str, data: Dict[str, Any]) -> bytes: ...
|
||||
|
||||
|
||||
def store_rendered_templates(
|
||||
store: Dict[str, Union[List[Template], ContextList]],
|
||||
signal: Signal,
|
||||
sender: Template,
|
||||
template: Template,
|
||||
context: Context,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class Client:
|
||||
def __init__(self, enforce_csrf_checks: bool = ..., **defaults) -> None: ...
|
||||
def _handle_redirects(
|
||||
self,
|
||||
response: Union[HttpResponseForbidden, HttpResponseRedirect],
|
||||
data: Any = ...,
|
||||
content_type: str = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def _login(self, user: AbstractBaseUser, backend: Optional[str] = ...) -> None: ...
|
||||
def _parse_json(self, response: HttpResponse, **extra) -> Dict[str, Union[int, str]]: ...
|
||||
def delete(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, Dict[str, str]] = ...,
|
||||
content_type: str = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def force_login(self, user: User, backend: Optional[str] = ...) -> None: ...
|
||||
def get(
|
||||
self,
|
||||
path: str,
|
||||
data: Optional[Union[Dict[str, str], QueryDict]] = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponseBase: ...
|
||||
def head(
|
||||
self,
|
||||
path: str,
|
||||
data: Optional[Dict[str, str]] = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def login(self, **credentials) -> bool: ...
|
||||
def logout(self) -> None: ...
|
||||
def options(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, Dict[str, str]] = ...,
|
||||
content_type: str = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def patch(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, Dict[str, str]] = ...,
|
||||
content_type: str = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def post(
|
||||
self,
|
||||
path: str,
|
||||
data: Any = ...,
|
||||
content_type: str = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def put(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, bytes] = ...,
|
||||
content_type: str = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def request(self, **request): ...
|
||||
@property
|
||||
def session(self) -> SessionBase: ...
|
||||
def store_exc_info(self, **kwargs) -> None: ...
|
||||
def trace(
|
||||
self,
|
||||
path: str,
|
||||
data: Dict[str, str] = ...,
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
|
||||
|
||||
class ClientHandler:
|
||||
def __call__(self, environ: Dict[str, Any]) -> HttpResponseBase: ...
|
||||
def __init__(self, enforce_csrf_checks: bool = ..., *args, **kwargs) -> None: ...
|
||||
|
||||
|
||||
class FakePayload:
|
||||
def __init__(self, content: Optional[Union[str, bytes]] = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def read(self, num_bytes: int = ...) -> bytes: ...
|
||||
def write(self, content: Union[str, bytes]) -> None: ...
|
||||
|
||||
|
||||
class RequestFactory:
|
||||
def __init__(self, *, json_encoder = ..., **defaults) -> None: ...
|
||||
def _base_environ(self, **request) -> Dict[str, Any]: ...
|
||||
def _encode_data(self, data: Any, content_type: str) -> bytes: ...
|
||||
def _encode_json(self, data: Any, content_type: str) -> Any: ...
|
||||
def _get_path(self, parsed: ParseResult) -> str: ...
|
||||
def delete(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, Dict[str, int]] = ...,
|
||||
content_type: str = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponse]: ...
|
||||
def generic(
|
||||
self,
|
||||
method: str,
|
||||
path: str,
|
||||
data: Union[str, bytes, Dict[str, str]] = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponseBase]: ...
|
||||
def get(
|
||||
self,
|
||||
path: str,
|
||||
data: Any = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponse, FileResponse]: ...
|
||||
def head(
|
||||
self,
|
||||
path: str,
|
||||
data: Optional[Dict[str, str]] = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponse]: ...
|
||||
def options(
|
||||
self,
|
||||
path: str,
|
||||
data: Dict[str, str] = ...,
|
||||
content_type: str = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponseRedirect: ...
|
||||
def patch(
|
||||
self,
|
||||
path: str,
|
||||
data: str = ...,
|
||||
content_type: str = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def post(
|
||||
self,
|
||||
path: str,
|
||||
data: Any = ...,
|
||||
content_type: str = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponseBase]: ...
|
||||
def put(
|
||||
self,
|
||||
path: str,
|
||||
data: Union[str, Dict[str, str]] = ...,
|
||||
content_type: str = ...,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> HttpResponse: ...
|
||||
def request(self, **request) -> WSGIRequest: ...
|
||||
def trace(
|
||||
self,
|
||||
path: str,
|
||||
secure: bool = ...,
|
||||
**extra
|
||||
) -> Union[WSGIRequest, HttpResponse]: ...
|
||||
51
django/test/html.pyi
Normal file
51
django/test/html.pyi
Normal file
@@ -0,0 +1,51 @@
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def normalize_whitespace(string: str) -> str: ...
|
||||
|
||||
|
||||
def parse_html(html: str) -> Element: ...
|
||||
|
||||
|
||||
class Element:
|
||||
def __contains__(self, element: Element) -> bool: ...
|
||||
def __eq__(self, element: Union[str, Element]) -> bool: ...
|
||||
def __getitem__(self, key: int) -> Union[str, Element]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __init__(
|
||||
self,
|
||||
name: Optional[str],
|
||||
attributes: Union[Tuple, List[Tuple[str, None]], List[Tuple[str, str]], List[Union[Tuple[str, str], Tuple[str, None]]]]
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def _count(self, element: Union[str, Element], count: bool = ...) -> int: ...
|
||||
def append(self, element: Union[str, Element]) -> None: ...
|
||||
def count(self, element: Element) -> int: ...
|
||||
def finalize(self) -> None: ...
|
||||
|
||||
|
||||
class Parser:
|
||||
def __init__(self) -> None: ...
|
||||
@property
|
||||
def current(self) -> Element: ...
|
||||
def handle_charref(self, name: str) -> None: ...
|
||||
def handle_data(self, data: str) -> None: ...
|
||||
def handle_endtag(self, tag: str) -> None: ...
|
||||
def handle_entityref(self, name: str) -> None: ...
|
||||
def handle_startendtag(self, tag: str, attrs: List[Tuple[str, str]]) -> None: ...
|
||||
def handle_starttag(
|
||||
self,
|
||||
tag: str,
|
||||
attrs: Union[List[Union[Tuple[str, str], Tuple[str, None]]], List[Tuple[str, str]]]
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class RootElement:
|
||||
def __init__(self) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
101
django/test/runner.pyi
Normal file
101
django/test/runner.pyi
Normal file
@@ -0,0 +1,101 @@
|
||||
from django.db.backends.dummy.base import DatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.test.testcases import (
|
||||
SimpleTestCase,
|
||||
TestCase,
|
||||
)
|
||||
from django.utils.datastructures import OrderedSet
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Set,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
from unittest.case import _SubTest
|
||||
from unittest.runner import TextTestResult
|
||||
from unittest.suite import TestSuite
|
||||
|
||||
|
||||
def default_test_processes() -> int: ...
|
||||
|
||||
|
||||
def filter_tests_by_tags(
|
||||
suite: TestSuite,
|
||||
tags: Set[str],
|
||||
exclude_tags: Set[str]
|
||||
) -> TestSuite: ...
|
||||
|
||||
|
||||
def is_discoverable(label: str) -> bool: ...
|
||||
|
||||
|
||||
def partition_suite_by_type(
|
||||
suite: TestSuite,
|
||||
classes: Tuple[Type[TestCase], Type[SimpleTestCase]],
|
||||
bins: List[OrderedSet],
|
||||
reverse: bool = ...
|
||||
) -> None: ...
|
||||
|
||||
|
||||
def reorder_suite(
|
||||
suite: TestSuite,
|
||||
classes: Tuple[Type[TestCase], Type[SimpleTestCase]],
|
||||
reverse: bool = ...
|
||||
) -> TestSuite: ...
|
||||
|
||||
|
||||
class DebugSQLTextTestResult:
|
||||
def addSubTest(self, test: TestCase, subtest: _SubTest, err: None) -> None: ...
|
||||
def printErrorList(
|
||||
self,
|
||||
flavour: str,
|
||||
errors: List[Union[Tuple[TestCase, str, str], Tuple[_SubTest, str, str]]]
|
||||
) -> None: ...
|
||||
def startTest(self, test: TestCase) -> None: ...
|
||||
def stopTest(self, test: TestCase) -> None: ...
|
||||
|
||||
|
||||
class DiscoverRunner:
|
||||
def __init__(
|
||||
self,
|
||||
pattern: None = ...,
|
||||
top_level: None = ...,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
failfast: bool = ...,
|
||||
keepdb: bool = ...,
|
||||
reverse: bool = ...,
|
||||
debug_mode: bool = ...,
|
||||
debug_sql: bool = ...,
|
||||
parallel: int = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
exclude_tags: None = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def build_suite(
|
||||
self,
|
||||
test_labels: Union[List[str], Tuple[str], Tuple[str, str]] = ...,
|
||||
extra_tests: None = ...,
|
||||
**kwargs
|
||||
) -> TestSuite: ...
|
||||
def get_resultclass(self) -> None: ...
|
||||
def get_test_runner_kwargs(self) -> Dict[str, Union[None, int]]: ...
|
||||
def run_checks(self) -> None: ...
|
||||
def run_suite(self, suite: TestSuite, **kwargs) -> TextTestResult: ...
|
||||
def run_tests(self, test_labels: List[str], extra_tests: List[Any] = ..., **kwargs) -> int: ...
|
||||
def setup_databases(
|
||||
self,
|
||||
**kwargs
|
||||
) -> Union[List[Tuple[DatabaseWrapper, str, bool]], List[Tuple[DatabaseWrapper, str, bool]]]: ...
|
||||
def setup_test_environment(self, **kwargs) -> None: ...
|
||||
def suite_result(self, suite: TestSuite, result: TextTestResult, **kwargs) -> int: ...
|
||||
def teardown_databases(
|
||||
self,
|
||||
old_config: Union[List[Tuple[DatabaseWrapper, str, bool]], List[Tuple[DatabaseWrapper, str, bool]]],
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def teardown_test_environment(self, **kwargs) -> None: ...
|
||||
20
django/test/selenium.pyi
Normal file
20
django/test/selenium.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.contrib.admin.tests import AdminSeleniumTestCase
|
||||
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
|
||||
from typing import (
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class SeleniumTestCaseBase:
|
||||
@staticmethod
|
||||
def __new__(
|
||||
cls: Type[SeleniumTestCaseBase],
|
||||
name: str,
|
||||
bases: Union[Tuple[Type[SeleniumTestCase], Type[StaticLiveServerTestCase]], Tuple[Type[AdminSeleniumTestCase]]],
|
||||
attrs: Dict[str, Union[str, List[str], Callable]]
|
||||
) -> Type[AdminSeleniumTestCase]: ...
|
||||
43
django/test/signals.pyi
Normal file
43
django/test/signals.pyi
Normal file
@@ -0,0 +1,43 @@
|
||||
def auth_password_validators_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def clear_cache_handlers(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def clear_routers_cache(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def clear_serializers_cache(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def complex_setting_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def file_storage_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def language_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def localize_settings_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def reset_template_engines(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def root_urlconf_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def static_finders_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def static_storage_changed(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def update_connections_time_zone(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def update_installed_apps(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def user_model_swapped(**kwargs) -> None: ...
|
||||
85
django/test/testcases.pyi
Normal file
85
django/test/testcases.pyi
Normal file
@@ -0,0 +1,85 @@
|
||||
from contextlib import _GeneratorContextManager
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.http.response import (
|
||||
HttpResponse,
|
||||
HttpResponseBase,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
from unittest.case import (
|
||||
_AssertRaisesContext,
|
||||
_AssertWarnsContext,
|
||||
)
|
||||
from unittest.runner import TextTestResult
|
||||
|
||||
|
||||
class CheckCondition:
|
||||
def __get__(self, instance: None, cls: Any = ...) -> bool: ...
|
||||
def __init__(self, *conditions) -> None: ...
|
||||
|
||||
|
||||
class LiveServerTestCase:
|
||||
@classmethod
|
||||
def _create_server_thread(
|
||||
cls,
|
||||
connections_override: Dict[str, DatabaseWrapper]
|
||||
) -> LiveServerThread: ...
|
||||
@classmethod
|
||||
def _tearDownClassInternal(cls) -> None: ...
|
||||
@classmethod
|
||||
def tearDownClass(cls) -> None: ...
|
||||
|
||||
|
||||
class LiveServerThread:
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
static_handler: Type[_StaticFilesHandler],
|
||||
connections_override: Dict[str, DatabaseWrapper] = ...,
|
||||
port: int = ...
|
||||
) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
|
||||
|
||||
class SimpleTestCase:
|
||||
def __call__(self, result: TextTestResult = ...) -> None: ...
|
||||
def _assertFooMessage(
|
||||
self,
|
||||
func: Callable,
|
||||
cm_attr: str,
|
||||
expected_exception: Any,
|
||||
expected_message: str,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> _GeneratorContextManager: ...
|
||||
def _assert_contains(
|
||||
self,
|
||||
response: HttpResponseBase,
|
||||
text: Union[str, bytes, int],
|
||||
status_code: int,
|
||||
msg_prefix: str,
|
||||
html: bool
|
||||
) -> Tuple[str, int, str]: ...
|
||||
def _assert_raises_or_warns_cm(
|
||||
self,
|
||||
func: Callable,
|
||||
cm_attr: str,
|
||||
expected_exception: Any,
|
||||
expected_message: str
|
||||
) -> Iterator[Union[_AssertRaisesContext, _AssertWarnsContext]]: ...
|
||||
def _assert_template_used(
|
||||
self,
|
||||
response: Optional[Union[str, HttpResponse]],
|
||||
template_name: Optional[str],
|
||||
msg_prefix: str
|
||||
) -> Union[Tuple[None, List[Any], str], Tuple[str, None, str], Tuple[None, List[str], str]]: ...
|
||||
def _post_teardown(self) -> None: ...
|
||||
169
django/test/utils.pyi
Normal file
169
django/test/utils.pyi
Normal file
@@ -0,0 +1,169 @@
|
||||
from io import StringIO
|
||||
from collections import OrderedDict
|
||||
from contextlib import _GeneratorContextManager
|
||||
from decimal import Decimal
|
||||
from django.apps.registry import Apps
|
||||
from django.conf import LazySettings
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.dummy.base import DatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.template.base import Template
|
||||
from django.template.context import Context
|
||||
from django.test.runner import DiscoverRunner
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def captured_output(stream_name: str) -> Iterator[StringIO]: ...
|
||||
|
||||
|
||||
def captured_stderr() -> _GeneratorContextManager: ...
|
||||
|
||||
|
||||
def captured_stdout() -> _GeneratorContextManager: ...
|
||||
|
||||
|
||||
def compare_xml(want: str, got: str) -> bool: ...
|
||||
|
||||
|
||||
def dependency_ordered(
|
||||
test_databases: List[Tuple[str, Tuple[str, List[str]]]],
|
||||
dependencies: Dict[str, List[str]]
|
||||
) -> List[Tuple[str, Tuple[str, List[str]]]]: ...
|
||||
|
||||
|
||||
def extend_sys_path(*paths) -> Iterator[None]: ...
|
||||
|
||||
|
||||
def freeze_time(t: int) -> Iterator[None]: ...
|
||||
|
||||
|
||||
def get_runner(
|
||||
settings: LazySettings,
|
||||
test_runner_class: Optional[str] = ...
|
||||
) -> Type[DiscoverRunner]: ...
|
||||
|
||||
|
||||
def get_unique_databases_and_mirrors() -> Tuple[OrderedDict, Dict[Any, Any]]: ...
|
||||
|
||||
|
||||
def instrumented_test_render(
|
||||
self: Template,
|
||||
context: Context
|
||||
) -> SafeText: ...
|
||||
|
||||
|
||||
def require_jinja2(test_func: Callable) -> Callable: ...
|
||||
|
||||
|
||||
def setup_databases(
|
||||
verbosity: int,
|
||||
interactive: bool,
|
||||
keepdb: bool = ...,
|
||||
debug_sql: bool = ...,
|
||||
parallel: int = ...,
|
||||
**kwargs
|
||||
) -> Union[List[Tuple[DatabaseWrapper, str, bool]], List[Tuple[DatabaseWrapper, str, bool]]]: ...
|
||||
|
||||
|
||||
def setup_test_environment(debug: bool = ...) -> None: ...
|
||||
|
||||
|
||||
def tag(*tags) -> Callable: ...
|
||||
|
||||
|
||||
def teardown_databases(
|
||||
old_config: List[Tuple[DatabaseWrapper, str, bool]],
|
||||
verbosity: int,
|
||||
parallel: int = ...,
|
||||
keepdb: bool = ...
|
||||
) -> None: ...
|
||||
|
||||
|
||||
def teardown_test_environment() -> None: ...
|
||||
|
||||
|
||||
class Approximate:
|
||||
def __eq__(self, other: Union[float, Decimal]) -> bool: ...
|
||||
def __init__(self, val: Union[float, Decimal], places: int = ...) -> None: ...
|
||||
|
||||
|
||||
class CaptureQueriesContext:
|
||||
def __enter__(self) -> CaptureQueriesContext: ...
|
||||
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
|
||||
def __getitem__(self, index: int) -> Dict[str, str]: ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: Union[DefaultConnectionProxy, backends.sqlite3.base.DatabaseWrapper]
|
||||
) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
@property
|
||||
def captured_queries(self) -> List[Dict[str, str]]: ...
|
||||
|
||||
|
||||
class ContextList:
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __getitem__(self, key: Union[str, int]) -> Any: ...
|
||||
def get(self, key: str, default: None = ...) -> str: ...
|
||||
|
||||
|
||||
class LoggingCaptureMixin:
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
|
||||
|
||||
class TestContextDecorator:
|
||||
def __call__(self, decorated: Any) -> Any: ...
|
||||
def __enter__(self) -> Optional[Apps]: ...
|
||||
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
|
||||
def __init__(self, attr_name: Optional[str] = ..., kwarg_name: Optional[str] = ...) -> None: ...
|
||||
def decorate_callable(self, func: Callable) -> Callable: ...
|
||||
def decorate_class(self, cls: Any) -> Any: ...
|
||||
|
||||
|
||||
class ignore_warnings:
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
def disable(self) -> None: ...
|
||||
def enable(self) -> None: ...
|
||||
|
||||
|
||||
class isolate_apps:
|
||||
def __init__(self, *installed_apps, **kwargs) -> None: ...
|
||||
def disable(self) -> None: ...
|
||||
def enable(self) -> Apps: ...
|
||||
|
||||
|
||||
class modify_settings:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def enable(self) -> None: ...
|
||||
def save_options(self, test_func: Any) -> None: ...
|
||||
|
||||
|
||||
class override_script_prefix:
|
||||
def __init__(self, prefix: str) -> None: ...
|
||||
def disable(self) -> None: ...
|
||||
def enable(self) -> None: ...
|
||||
|
||||
|
||||
class override_settings:
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
def decorate_class(self, cls: Any) -> Any: ...
|
||||
def disable(self) -> None: ...
|
||||
def enable(self) -> None: ...
|
||||
def save_options(self, test_func: Any) -> None: ...
|
||||
|
||||
|
||||
class override_system_checks:
|
||||
def __init__(self, new_checks: List[Callable], deployment_checks: Optional[List[Callable]] = ...) -> None: ...
|
||||
def disable(self) -> None: ...
|
||||
def enable(self) -> None: ...
|
||||
Reference in New Issue
Block a user