mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-14 02:23:19 +03:00
Merge pull request #5626 from rpkilby/update-reqs
Update test requirements
This commit is contained in:
commit
c782376555
|
@ -3,5 +3,5 @@ skip=.tox
|
||||||
atomic=true
|
atomic=true
|
||||||
multi_line_output=5
|
multi_line_output=5
|
||||||
known_standard_library=types
|
known_standard_library=types
|
||||||
known_third_party=pytest,django
|
known_third_party=pytest,_pytest,django
|
||||||
known_first_party=rest_framework
|
known_first_party=rest_framework
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# PEP8 code linting, which we run on all commits.
|
# PEP8 code linting, which we run on all commits.
|
||||||
flake8==3.4.1
|
flake8==3.5.0
|
||||||
flake8-tidy-imports==1.1.0
|
flake8-tidy-imports==1.1.0
|
||||||
pep8==1.7.0
|
pycodestyle==2.3.1
|
||||||
|
|
||||||
# Sort and lint imports
|
# Sort and lint imports
|
||||||
isort==4.2.5
|
isort==4.2.15
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
pytz==2017.2
|
pytz==2017.2
|
||||||
markdown==2.6.4
|
markdown==2.6.4
|
||||||
django-guardian==1.4.9
|
django-guardian==1.4.9
|
||||||
django-filter==1.0.4
|
django-filter==1.1.0
|
||||||
coreapi==2.3.1
|
coreapi==2.3.1
|
||||||
coreschema==0.0.4
|
coreschema==0.0.4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# PyTest for running the tests.
|
# PyTest for running the tests.
|
||||||
pytest==3.2.2
|
pytest==3.2.5
|
||||||
pytest-django==3.1.2
|
pytest-django==3.1.2
|
||||||
pytest-cov==2.5.1
|
pytest-cov==2.5.1
|
||||||
|
|
|
@ -260,7 +260,7 @@ class AutoSchema(ViewInspector):
|
||||||
# Attempt to infer a field description if possible.
|
# Attempt to infer a field description if possible.
|
||||||
try:
|
try:
|
||||||
model_field = model._meta.get_field(variable)
|
model_field = model._meta.get_field(variable)
|
||||||
except:
|
except Exception:
|
||||||
model_field = None
|
model_field = None
|
||||||
|
|
||||||
if model_field is not None and model_field.verbose_name:
|
if model_field is not None and model_field.verbose_name:
|
||||||
|
|
|
@ -10,6 +10,7 @@ from django.utils import six
|
||||||
from django.utils.encoding import force_text, iri_to_uri
|
from django.utils.encoding import force_text, iri_to_uri
|
||||||
from django.utils.html import escape, format_html, smart_urlquote
|
from django.utils.html import escape, format_html, smart_urlquote
|
||||||
from django.utils.safestring import SafeData, mark_safe
|
from django.utils.safestring import SafeData, mark_safe
|
||||||
|
|
||||||
from rest_framework.compat import apply_markdown, pygments_highlight
|
from rest_framework.compat import apply_markdown, pygments_highlight
|
||||||
from rest_framework.renderers import HTMLFormRenderer
|
from rest_framework.renderers import HTMLFormRenderer
|
||||||
from rest_framework.utils.urls import replace_query_param
|
from rest_framework.utils.urls import replace_query_param
|
||||||
|
|
|
@ -61,7 +61,7 @@ class JSONEncoder(json.JSONEncoder):
|
||||||
elif hasattr(obj, '__getitem__'):
|
elif hasattr(obj, '__getitem__'):
|
||||||
try:
|
try:
|
||||||
return dict(obj)
|
return dict(obj)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
elif hasattr(obj, '__iter__'):
|
elif hasattr(obj, '__iter__'):
|
||||||
return tuple(item for item in obj)
|
return tuple(item for item in obj)
|
||||||
|
|
|
@ -19,7 +19,6 @@ from rest_framework.utils.representation import smart_repr
|
||||||
# Robust filter and exist implementations. Ensures that queryset.exists() for
|
# Robust filter and exist implementations. Ensures that queryset.exists() for
|
||||||
# an invalid value returns `False`, rather than raising an error.
|
# an invalid value returns `False`, rather than raising an error.
|
||||||
# Refs https://github.com/encode/django-rest-framework/issues/3381
|
# Refs https://github.com/encode/django-rest-framework/issues/3381
|
||||||
|
|
||||||
def qs_exists(queryset):
|
def qs_exists(queryset):
|
||||||
try:
|
try:
|
||||||
return queryset.exists()
|
return queryset.exists()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from tests import importable
|
from tests import importable
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ indented
|
||||||
}]
|
}]
|
||||||
```"""
|
```"""
|
||||||
|
|
||||||
|
|
||||||
# If markdown is installed we also test it's working
|
# If markdown is installed we also test it's working
|
||||||
# (and that our wrapped forces '=' to h2 and '-' to h3)
|
# (and that our wrapped forces '=' to h2 and '-' to h3)
|
||||||
|
|
||||||
MARKED_DOWN_HILITE = """
|
MARKED_DOWN_HILITE = """
|
||||||
<div class="highlight"><pre><span></span><span \
|
<div class="highlight"><pre><span></span><span \
|
||||||
class="p">[{</span><br /> <span class="nt">"alpha"</span><span\
|
class="p">[{</span><br /> <span class="nt">"alpha"</span><span\
|
||||||
|
|
|
@ -10,7 +10,6 @@ from tests.test_multitable_inheritance import ChildModel
|
||||||
|
|
||||||
|
|
||||||
# Regression test for #4290
|
# Regression test for #4290
|
||||||
|
|
||||||
class ChildAssociatedModel(RESTFrameworkModel):
|
class ChildAssociatedModel(RESTFrameworkModel):
|
||||||
child_model = models.OneToOneField(ChildModel, on_delete=models.CASCADE)
|
child_model = models.OneToOneField(ChildModel, on_delete=models.CASCADE)
|
||||||
child_name = models.CharField(max_length=100)
|
child_name = models.CharField(max_length=100)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user