enable some test folders, bunch of fixes

This commit is contained in:
Maxim Kurnikov
2019-02-07 00:08:05 +03:00
parent d43cb1fcd7
commit 191496ed72
25 changed files with 208 additions and 173 deletions
+2 -2
View File
@@ -235,7 +235,7 @@ class ModelChoiceField(ChoiceField):
iterator: Any = ...
empty_label: Optional[str] = ...
queryset: Any = ...
limit_choices_to: None = ...
limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ...
to_field_name: None = ...
def __init__(
self,
@@ -248,7 +248,7 @@ class ModelChoiceField(ChoiceField):
initial: Optional[Any] = ...,
help_text: str = ...,
to_field_name: Optional[Any] = ...,
limit_choices_to: Optional[Any] = ...,
limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ...,
**kwargs: Any
) -> None: ...
def get_limit_choices_to(self) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ...
+4 -2
View File
@@ -1,6 +1,6 @@
from collections import UserList
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, Sequence
from django.core.exceptions import ValidationError
from django.utils.safestring import SafeText
@@ -18,7 +18,9 @@ class ErrorDict(dict):
class ErrorList(UserList):
data: List[Union[ValidationError, str]]
error_class: str = ...
def __init__(self, initlist: Optional[ErrorList] = ..., error_class: Optional[str] = ...) -> None: ...
def __init__(
self, initlist: Optional[Union[ErrorList, Sequence[str]]] = ..., error_class: Optional[str] = ...
) -> None: ...
def as_data(self) -> List[ValidationError]: ...
def get_json_data(self, escape_html: bool = ...) -> List[Dict[str, str]]: ...
def as_json(self, escape_html: bool = ...) -> str: ...