mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-21 17:16:47 +03:00
pre-commit autoupdate (#9232)
This commit is contained in:
parent
f85d8cb81a
commit
74689b1f44
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.4.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
|
@ -9,17 +9,17 @@ repos:
|
||||||
- id: check-symlinks
|
- id: check-symlinks
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
- repo: https://github.com/pycqa/isort
|
- repo: https://github.com/pycqa/isort
|
||||||
rev: 5.12.0
|
rev: 5.13.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 3.9.0
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- flake8-tidy-imports
|
- flake8-tidy-imports
|
||||||
- repo: https://github.com/adamchainz/blacken-docs
|
- repo: https://github.com/adamchainz/blacken-docs
|
||||||
rev: 1.13.0
|
rev: 1.16.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: blacken-docs
|
- id: blacken-docs
|
||||||
exclude: ^(?!docs).*$
|
exclude: ^(?!docs).*$
|
||||||
|
|
|
@ -64,14 +64,10 @@ from rest_framework.schemas import get_schema_view
|
||||||
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
|
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
|
||||||
|
|
||||||
schema_view = get_schema_view(
|
schema_view = get_schema_view(
|
||||||
title='Example API',
|
title="Example API", renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
|
||||||
renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [path("swagger/", schema_view), ...]
|
||||||
path('swagger/', schema_view),
|
|
||||||
...
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
There have been a large number of fixes to the schema generation. These should
|
There have been a large number of fixes to the schema generation. These should
|
||||||
|
|
|
@ -36,7 +36,7 @@ def api_view(http_method_names=None):
|
||||||
# WrappedAPIView.__doc__ = func.doc <--- Not possible to do this
|
# WrappedAPIView.__doc__ = func.doc <--- Not possible to do this
|
||||||
|
|
||||||
# api_view applied without (method_names)
|
# api_view applied without (method_names)
|
||||||
assert not(isinstance(http_method_names, types.FunctionType)), \
|
assert not isinstance(http_method_names, types.FunctionType), \
|
||||||
'@api_view missing list of allowed HTTP methods'
|
'@api_view missing list of allowed HTTP methods'
|
||||||
|
|
||||||
# api_view applied with eg. string instead of list of strings
|
# api_view applied with eg. string instead of list of strings
|
||||||
|
|
|
@ -192,7 +192,7 @@ class ThrottlingTests(TestCase):
|
||||||
if expect is not None:
|
if expect is not None:
|
||||||
assert response['Retry-After'] == expect
|
assert response['Retry-After'] == expect
|
||||||
else:
|
else:
|
||||||
assert not'Retry-After' in response
|
assert 'Retry-After' not in response
|
||||||
|
|
||||||
def test_seconds_fields(self):
|
def test_seconds_fields(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user