mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Correct deprecation warning message
This commit is contained in:
parent
0cd24b455f
commit
853dd233a2
|
@ -150,7 +150,7 @@ class EndpointEnumerator(object):
|
||||||
return False # Ignore anything except REST framework views.
|
return False # Ignore anything except REST framework views.
|
||||||
|
|
||||||
if hasattr(callback.cls, 'exclude_from_schema'):
|
if hasattr(callback.cls, 'exclude_from_schema'):
|
||||||
fmt = ("The `{}.exclude_from_schema` is pending deprecation. "
|
fmt = ("The `{}.exclude_from_schema` attribute is pending deprecation. "
|
||||||
"Set `schema = None` instead.")
|
"Set `schema = None` instead.")
|
||||||
msg = fmt.format(callback.cls.__name__)
|
msg = fmt.format(callback.cls.__name__)
|
||||||
warnings.warn(msg, PendingDeprecationWarning)
|
warnings.warn(msg, PendingDeprecationWarning)
|
||||||
|
|
|
@ -717,6 +717,6 @@ class SchemaGenerationExclusionTests(TestCase):
|
||||||
|
|
||||||
assert len(record) == 1
|
assert len(record) == 1
|
||||||
assert str(record[0].message) == (
|
assert str(record[0].message) == (
|
||||||
"The `OldFashionedExcludedView.exclude_from_schema` is "
|
"The `OldFashionedExcludedView.exclude_from_schema` attribute is "
|
||||||
"pending deprecation. Set `schema = None` instead."
|
"pending deprecation. Set `schema = None` instead."
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user