From 30622464d516c952b40fd6241c69c50502a1265f Mon Sep 17 00:00:00 2001 From: DoctorJohn Date: Sun, 7 Jun 2020 12:20:13 +0200 Subject: [PATCH] Start raising DeprecationWarnings for using only_fields and exclude_fields --- graphene_django/tests/test_types.py | 4 ++-- graphene_django/types.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graphene_django/tests/test_types.py b/graphene_django/tests/test_types.py index 1986568c7..6587b98b0 100644 --- a/graphene_django/tests/test_types.py +++ b/graphene_django/tests/test_types.py @@ -290,7 +290,7 @@ def inner(*args, **kwargs): @with_local_registry def test_django_objecttype_only_fields(): - with pytest.warns(PendingDeprecationWarning): + with pytest.warns(DeprecationWarning): class Reporter(DjangoObjectType): class Meta: @@ -347,7 +347,7 @@ class Meta: @with_local_registry def test_django_objecttype_exclude_fields(): - with pytest.warns(PendingDeprecationWarning): + with pytest.warns(DeprecationWarning): class Reporter(DjangoObjectType): class Meta: diff --git a/graphene_django/types.py b/graphene_django/types.py index f3894213e..f00be1c83 100644 --- a/graphene_django/types.py +++ b/graphene_django/types.py @@ -194,7 +194,7 @@ def __init_subclass_with_meta__( if only_fields: warnings.warn( "Defining `only_fields` is deprecated in favour of `fields`.", - PendingDeprecationWarning, + DeprecationWarning, stacklevel=2, ) fields = only_fields @@ -210,7 +210,7 @@ def __init_subclass_with_meta__( if exclude_fields: warnings.warn( "Defining `exclude_fields` is deprecated in favour of `exclude`.", - PendingDeprecationWarning, + DeprecationWarning, stacklevel=2, ) exclude = exclude_fields