Bump PendingDeprecationWarning to DeprecationWarning

* as it is a major release 3, start right away from DeprecationWarning for ObjectTypes missing fields or exclude option
* updated docs information to be more forbidding
This commit is contained in:
radoslaw.kowalski 2020-06-11 11:04:19 +02:00
parent 3d497ea094
commit 8054803fde
3 changed files with 4 additions and 5 deletions

View File

@ -54,9 +54,8 @@ all fields that should be exposed using the fields attribute.
This will make it less likely to result in unintentionally exposing data when
your models change.
Setting neither ``fields`` nor ``exclude`` is allowed but will raise a warning, to
avoid that you can easily make ``DjangoObjectType`` include all fields in the model as
described below.
Setting neither ``fields`` nor ``exclude`` is deprecated and will raise a warning, you should at least explicitly make
``DjangoObjectType`` include all fields in the model as described below.
``fields``
~~~~~~~~~~

View File

@ -482,7 +482,7 @@ def test_django_objecttype_exclude_fields_exist_on_model():
@with_local_registry
def test_django_objecttype_neither_fields_nor_exclude():
with pytest.warns(
PendingDeprecationWarning,
DeprecationWarning,
match=r"Creating a DjangoObjectType without either the `fields` "
"or the `exclude` option is deprecated.",
):

View File

@ -226,7 +226,7 @@ class DjangoObjectType(ObjectType):
"or the `exclude` option is deprecated. Add an explicit `fields "
"= '__all__'` option on DjangoObjectType {class_name} to use all "
"fields".format(class_name=cls.__name__,),
PendingDeprecationWarning,
DeprecationWarning,
stacklevel=2,
)