fourth iteration

This commit is contained in:
Maxim Kurnikov committed 2018-08-11 02:23:18 +03:00
1 parent c6bceb19f4
commit 8cc446150c
113 files changed
+2285 -9835

No files matched your search

+2 -35
View File
@@ -14,7 +14,6 @@ from django.http.response import (HttpResponse, HttpResponseBase,
HttpResponseRedirect)
from django.template.base import Template
from django.template.context import Context
from django.test.utils import ContextList
class RedirectCycleError(Exception):
@@ -36,28 +35,7 @@ class ClientHandler(BaseHandler):
def __init__(
self, enforce_csrf_checks: bool = ..., *args: Any, **kwargs: Any
) -> None: ...
def __call__(
self,
environ: Union[
Dict[
str,
Optional[
Union[Tuple[int, int], BytesIO, FakePayload, int, str]
],
],
Dict[
str,
Union[
Dict[str, str],
Tuple[int, int],
BytesIO,
FakePayload,
int,
str,
],
],
],
) -> HttpResponseBase: ...
def __call__(self, environ: Dict[str, Any]) -> HttpResponseBase: ...
def encode_multipart(
boundary: str,
@@ -80,18 +58,7 @@ def encode_multipart(
Dict[str, SimpleUploadedFile],
],
) -> bytes: ...
def encode_file(
boundary: str,
key: str,
file: Union[
BufferedRandom,
BufferedReader,
BytesIO,
StringIO,
SimpleUploadedFile,
_TemporaryFileWrapper,
],
) -> List[bytes]: ...
def encode_file(boundary: str, key: str, file: Any) -> List[bytes]: ...
class RequestFactory:
json_encoder: Type[django.core.serializers.json.DjangoJSONEncoder] = ...
+4 -6
View File
@@ -7,14 +7,12 @@ def normalize_whitespace(string: str) -> str: ...
class Element:
name: str = ...
attributes: List[Union[Tuple[str, None], Tuple[str, str]]] = ...
attributes: List[Tuple[str, Optional[str]]] = ...
children: List[Union[django.test.html.Element, str]] = ...
def __init__(
self,
name: Optional[str],
attributes: Union[
List[Union[Tuple[str, None], Tuple[str, str]]], Tuple
],
attributes: Union[List[Tuple[str, Optional[str]]], Tuple],
) -> None: ...
def append(self, element: Union[Element, str]) -> None: ...
def finalize(self) -> None: ...
@@ -45,10 +43,10 @@ class Parser(HTMLParser):
@property
def current(self) -> Element: ...
def handle_startendtag(
self, tag: str, attrs: List[Union[Tuple[str, None], Tuple[str, str]]]
self, tag: str, attrs: List[Tuple[str, Optional[str]]]
) -> None: ...
def handle_starttag(
self, tag: str, attrs: List[Union[Tuple[str, None], Tuple[str, str]]]
self, tag: str, attrs: List[Tuple[str, Optional[str]]]
) -> None: ...
def handle_endtag(self, tag: str) -> None: ...
def handle_data(self, data: str) -> None: ...
+2 -12
View File
@@ -14,20 +14,10 @@ class DebugSQLTextTestResult(unittest.TextTestResult):
buffer: bool
descriptions: bool
dots: bool
errors: List[
Union[
Tuple[django.test.testcases.TestCase, str, str],
Tuple[unittest.case._SubTest, str, str],
]
]
errors: List[Tuple[unittest.case.TestCase, str, str]]
expectedFailures: List[Any]
failfast: bool
failures: List[
Union[
Tuple[django.test.testcases.TestCase, str, str],
Tuple[unittest.case._SubTest, str, str],
]
]
failures: List[Tuple[unittest.case.TestCase, str, str]]
shouldStop: bool
showAll: bool
skipped: List[Any]
+5 -40
View File
@@ -1,12 +1,10 @@
import threading
import unittest
from contextlib import _GeneratorContextManager
from datetime import date, time, timedelta
from decimal import Decimal
from datetime import date
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
Type, Union)
from unittest.runner import TextTestResult
from uuid import UUID
from django.contrib.staticfiles.handlers import StaticFilesHandler
from django.core.handlers.wsgi import WSGIHandler
@@ -19,8 +17,8 @@ from django.forms.fields import EmailField
from django.http.response import HttpResponse, HttpResponseBase
from django.template.context import Context
from django.test.html import Element
from django.test.utils import (Approximate, CaptureQueriesContext,
modify_settings, override_settings)
from django.test.utils import (CaptureQueriesContext, modify_settings,
override_settings)
from django.utils.deprecation import RemovedInDjango30Warning
from django.utils.safestring import SafeText
@@ -209,45 +207,12 @@ class TransactionTestCase(SimpleTestCase):
qs: Union[Iterator[Any], List[Model], QuerySet, RawQuerySet],
values: Union[
List[Optional[str]],
List[Tuple[Any, Any]],
List[Tuple[Model, Model]],
List[Tuple[Model, int, int]],
List[Tuple[str, Type[Model], int]],
List[
Union[
Tuple[
Optional[
Union[
bytes,
date,
time,
timedelta,
Decimal,
Approximate,
float,
int,
str,
UUID,
]
],
Optional[
Union[
bytes,
date,
time,
timedelta,
Decimal,
Approximate,
float,
int,
str,
UUID,
]
],
],
int,
]
],
List[date],
List[int],
Set[str],
QuerySet,
],
+49 -102
View File
@@ -7,21 +7,14 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
from django.apps.registry import Apps
from django.conf import LazySettings
from django.contrib.admin.helpers import AdminForm
from django.contrib.admin.views.main import ChangeList
from django.contrib.messages.storage.fallback import FallbackStorage
from django.db import DefaultConnectionProxy
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.models.base import Model
from django.forms.forms import BaseForm
from django.forms.widgets import Media
from django.template.base import Template
from django.template.context import Context
from django.test.runner import DiscoverRunner
from django.test.testcases import SimpleTestCase
from django.utils.safestring import SafeText
from django.views.generic.detail import SingleObjectTemplateResponseMixin
class Approximate:
@@ -33,23 +26,7 @@ class Approximate:
def __eq__(self, other: Union[Decimal, float]) -> bool: ...
class ContextList(list):
def __getitem__(
self, key: Union[int, str]
) -> Optional[
Union[
List[Union[List[str], str]],
bool,
AdminForm,
ChangeList,
FallbackStorage,
Model,
BaseForm,
Media,
Context,
SingleObjectTemplateResponseMixin,
str,
]
]: ...
def __getitem__(self, key: Union[int, str]) -> Any: ...
def get(self, key: str, default: Optional[str] = ...) -> str: ...
def __contains__(self, key: str) -> bool: ...
def keys(self) -> Set[str]: ...
@@ -60,7 +37,7 @@ def setup_test_environment(debug: Optional[bool] = ...) -> None: ...
def teardown_test_environment() -> None: ...
def get_runner(
settings: LazySettings, test_runner_class: Optional[str] = ...
) -> Type[Union[Any, DiscoverRunner]]: ...
) -> Type[DiscoverRunner]: ...
class TestContextDecorator:
attr_name: Any = ...
@@ -95,35 +72,45 @@ class override_settings(TestContextDecorator):
Dict[
str,
Union[
Dict[str, Optional[str]],
Dict[str, Union[Callable, Dict[str, int], str]],
Dict[str, Union[Dict[str, int], int, str]],
Dict[
str,
Union[
Callable, Dict[str, Union[Dict[str, bool], bool]]
],
],
Dict[
str, Union[Dict[str, Union[Dict[str, bool], bool]], int]
],
Dict[
str, Union[Dict[str, Union[Dict[str, bool], bool]], str]
],
],
],
],
Dict[
str,
List[
Dict[
str, Union[Dict[str, List[Tuple[str, Dict[str, str]]]], str]
]
],
],
Dict[
str,
List[
Union[
Dict[str, Union[Dict[Any, Any], bool, str]],
Dict[str, Union[Dict[str, bool], bool, str]],
]
Dict[
str,
Union[
Dict[str, Union[Callable, Dict[str, int], str]],
Dict[str, Union[Dict[str, int], int, str]],
],
],
],
Dict[str, List[Dict[str, Union[Dict[Any, Any], bool, str]]]],
Dict[
str,
List[
Union[
Dict[
str,
Union[
Dict[str, List[Tuple[str, Dict[str, str]]]],
bool,
str,
],
],
Dict[str, Union[Dict[str, List[str]], str]],
Dict[str, Union[bool, str]],
]
],
],
@@ -131,16 +118,7 @@ class override_settings(TestContextDecorator):
str,
List[
Union[
Dict[str, Union[Dict[str, bool], str]],
Dict[str, Union[Dict[str, int], str]],
]
],
],
Dict[
str,
List[
Union[
Dict[str, Union[Dict[str, int], str]],
Dict[str, Union[Dict[str, int], bool, str]],
Dict[str, Union[Dict[str, str], str]],
]
],
@@ -152,69 +130,25 @@ class override_settings(TestContextDecorator):
Dict[str, Type[Any]],
Dict[str, Union[Callable, bool]],
Dict[str, Union[Dict[int, None], bool]],
Dict[str, Union[Dict[str, None], List[str]]],
Dict[str, Union[Dict[str, Optional[str]], str]],
Dict[
str,
Union[
Dict[
str,
Union[
Dict[Any, Any],
Dict[str, Callable],
Dict[str, int],
Dict[str, str],
],
],
List[
Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]
],
List[Union[Tuple[str, str], str]],
int,
str,
Dict[str, Dict[str, Optional[str]]], List[Tuple[str, str]], str
],
],
Dict[str, Union[Dict[str, Optional[str]], List[str]]],
Dict[
str,
Union[
Dict[
str,
Union[
Dict[str, Dict[str, Union[List[str], bool, str]]],
Dict[str, Dict[str, str]],
int,
Dict[str, Dict[str, Union[List[str], bool, str]]], int
],
],
str,
],
],
Dict[
str,
Union[
Dict[
str,
Union[
Dict[
str,
Union[
Callable,
Dict[str, Union[Dict[str, bool], bool]],
],
],
Dict[
str,
Union[Dict[str, Union[Dict[str, bool], bool]], int],
],
Dict[
str,
Union[Dict[str, Union[Dict[str, bool], bool]], str],
],
str,
],
],
List[str],
],
],
Dict[
str,
Union[
@@ -224,13 +158,15 @@ class override_settings(TestContextDecorator):
Dict[str, Union[Callable, str]],
Dict[str, Union[Dict[str, int], str]],
Dict[str, Union[int, str]],
Dict[str, str],
],
],
bool,
],
],
Dict[str, Union[Dict[str, Union[Dict[str, str], str]], bool]],
Dict[
str,
Union[Dict[str, Union[Dict[str, str], str]], List[str], int, str],
],
Dict[
str,
Union[
@@ -240,6 +176,17 @@ class override_settings(TestContextDecorator):
List[str],
],
],
Dict[
str,
Union[
List[
Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]
],
List[Union[Tuple[str, str], str]],
int,
str,
],
],
Dict[
str,
Union[
@@ -271,7 +218,7 @@ class modify_settings(override_settings):
kwarg_name: None
wrapped: Union[django.conf.Settings, django.conf.UserSettingsHolder]
operations: List[
Union[Tuple[str, Dict[str, List[str]]], Tuple[str, Dict[str, str]]]
Tuple[str, Union[Dict[str, List[str]], Dict[str, str]]]
] = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def save_options(self, test_func: Type[SimpleTestCase]) -> None: ...