mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-11-04 09:57:53 +03:00 
			
		
		
		
	Start raising DeprecationWarnings for using only_fields and exclude_fields (v3) (#980)
This commit is contained in:
		
							parent
							
								
									26c4c48abc
								
							
						
					
					
						commit
						85976ffb1f
					
				| 
						 | 
					@ -263,7 +263,7 @@ def with_local_registry(func):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@with_local_registry
 | 
					@with_local_registry
 | 
				
			||||||
def test_django_objecttype_only_fields():
 | 
					def test_django_objecttype_only_fields():
 | 
				
			||||||
    with pytest.warns(PendingDeprecationWarning):
 | 
					    with pytest.warns(DeprecationWarning):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        class Reporter(DjangoObjectType):
 | 
					        class Reporter(DjangoObjectType):
 | 
				
			||||||
            class Meta:
 | 
					            class Meta:
 | 
				
			||||||
| 
						 | 
					@ -320,7 +320,7 @@ def test_django_objecttype_all_fields():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@with_local_registry
 | 
					@with_local_registry
 | 
				
			||||||
def test_django_objecttype_exclude_fields():
 | 
					def test_django_objecttype_exclude_fields():
 | 
				
			||||||
    with pytest.warns(PendingDeprecationWarning):
 | 
					    with pytest.warns(DeprecationWarning):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        class Reporter(DjangoObjectType):
 | 
					        class Reporter(DjangoObjectType):
 | 
				
			||||||
            class Meta:
 | 
					            class Meta:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -194,7 +194,7 @@ class DjangoObjectType(ObjectType):
 | 
				
			||||||
        if only_fields:
 | 
					        if only_fields:
 | 
				
			||||||
            warnings.warn(
 | 
					            warnings.warn(
 | 
				
			||||||
                "Defining `only_fields` is deprecated in favour of `fields`.",
 | 
					                "Defining `only_fields` is deprecated in favour of `fields`.",
 | 
				
			||||||
                PendingDeprecationWarning,
 | 
					                DeprecationWarning,
 | 
				
			||||||
                stacklevel=2,
 | 
					                stacklevel=2,
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            fields = only_fields
 | 
					            fields = only_fields
 | 
				
			||||||
| 
						 | 
					@ -210,7 +210,7 @@ class DjangoObjectType(ObjectType):
 | 
				
			||||||
        if exclude_fields:
 | 
					        if exclude_fields:
 | 
				
			||||||
            warnings.warn(
 | 
					            warnings.warn(
 | 
				
			||||||
                "Defining `exclude_fields` is deprecated in favour of `exclude`.",
 | 
					                "Defining `exclude_fields` is deprecated in favour of `exclude`.",
 | 
				
			||||||
                PendingDeprecationWarning,
 | 
					                DeprecationWarning,
 | 
				
			||||||
                stacklevel=2,
 | 
					                stacklevel=2,
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            exclude = exclude_fields
 | 
					            exclude = exclude_fields
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user