* proper redirect return type annotations made with Literal
* Mapping instead of Dict type annotation for context in render() with test
* removed Union and Context
* typo
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
Add __init__ to OrderedSet (#381)
Issue 382 (#384)
* WIP fix, pushed for testing
* added _ prefix for internal types
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
Fix parameter types for assertJSONEqual/NotEqual (#385)
Add get_supported_language_variant (#386)
Issue 309 (#383)
* added tags for user models
* type test for HttpRequest.user
* test for User and AnonymousUser tags
* httrequest test fix
* checking python version fix for readibility
* Rewrite version check for readability
* Annotate is_authenticated/is_anonymous with Literal-type
* Add auth in INSTALLED_APPS in test
* Fix wrong type assertion in test
* Fix misconception of how branch-testing works
* Remove user from WSGIRequest
* Change HttpRequest-transformer to set user-type to include AnonymousUser
* Add check for anonymous_user_info=None to appease mypy
* Isort transformers/request
* Remove trailing whitespace
* Remove unused import
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
* fix formatting and unused import
* reformatted again
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
* added tags for user models
* type test for HttpRequest.user
* test for User and AnonymousUser tags
* httrequest test fix
* checking python version fix for readibility
* Rewrite version check for readability
* Annotate is_authenticated/is_anonymous with Literal-type
* Add auth in INSTALLED_APPS in test
* Fix wrong type assertion in test
* Fix misconception of how branch-testing works
* Remove user from WSGIRequest
* Change HttpRequest-transformer to set user-type to include AnonymousUser
* Add check for anonymous_user_info=None to appease mypy
* Isort transformers/request
* Remove trailing whitespace
* Remove unused import
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
* Mapping instead of Dict type annotation for context in render() with test
* removed Union and Context
* typo
Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
This is valid Django, which failed to pass with the old type-defintion:
class MyForm(Form):
myparam = MultiFileField(...)
self.clean(self, *args, **kwargs):
self.files.getlist('myparam', [])
By declaring return type as -> Callable[[_C], _C], Mypy can infer that
the decorated function has also the same arguments and return type as
the original.
View functions are constrained to return HttpResponseBase (or any
subclass of it).
Also added typecheck test coverage to most of the cases.
* Updated gitpython dependency to fix error:
ModuleNotFoundError: No module named 'gitdb.utils.compat'
* Updated Django repository git refs because old 3.0.x commit hash gave error:
stderr: 'fatal: reference is not a tree: 6cb30414bc0f83b49afc4cae76d4af5656effe9a'
* Newer Django version also needs new ignores.
* Added missing `follow: bool` argument to Client request methods.
* Annotated return types as `HttpResponse` instead of `Any`.
* Made `Client` class inherit from `RequestFactory`, as it does in Django.
* Changed `json()` return type to Any, as it can also be a list.
Wrt (2), these return types were reverted from `HttpResponse` to `Any`
in commit 287c64d6fb. But I suspect that
was simply to silence mypy warnings about "incompatible with supertype
RequestFactory", not because there were any issues with the annotation.
Note that `Client.request()` monkey-patches the `HttpResponse` object
with some additional attributes. Those attributes were already annotated
before, I reordered and added additional comments to make it clear where
they come from.
* BaseManager.from_queryset() from another file
* only anal_type per argument
* add resolve for return_type
* fix mypy errors
* remove leftover comment