mirror of
				https://github.com/graphql-python/graphene-django.git
				synced 2025-11-04 01:47:57 +03:00 
			
		
		
		
	* Use ruff in pre-commit * Add pyupgrade * Add isort * Add bugbear * Fix B015 Pointless comparison * Fix B026 * B018 false positive * Remove flake8 and isort config from setup.cfg * Remove black and flake8 from dev dependencies * Update black * Show list of fixes applied with autofix on * Fix typo * Add C4 flake8-comprehensions * Add ruff to dev dependencies * Fix up
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
import pytest
 | 
						|
from django.test import Client
 | 
						|
 | 
						|
from ...settings import graphene_settings
 | 
						|
from ...tests.test_types import with_local_registry
 | 
						|
from .. import GraphQLTestCase
 | 
						|
 | 
						|
 | 
						|
@with_local_registry
 | 
						|
def test_graphql_test_case_deprecated_client_getter():
 | 
						|
    """
 | 
						|
    `GraphQLTestCase._client`' getter should raise pending deprecation warning.
 | 
						|
    """
 | 
						|
 | 
						|
    class TestClass(GraphQLTestCase):
 | 
						|
        GRAPHQL_SCHEMA = True
 | 
						|
 | 
						|
        def runTest(self):
 | 
						|
            pass
 | 
						|
 | 
						|
    tc = TestClass()
 | 
						|
    tc._pre_setup()
 | 
						|
    tc.setUpClass()
 | 
						|
 | 
						|
    with pytest.warns(PendingDeprecationWarning):
 | 
						|
        tc._client  # noqa: B018
 | 
						|
 | 
						|
 | 
						|
@with_local_registry
 | 
						|
def test_graphql_test_case_deprecated_client_setter():
 | 
						|
    """
 | 
						|
    `GraphQLTestCase._client`' setter should raise pending deprecation warning.
 | 
						|
    """
 | 
						|
 | 
						|
    class TestClass(GraphQLTestCase):
 | 
						|
        GRAPHQL_SCHEMA = True
 | 
						|
 | 
						|
        def runTest(self):
 | 
						|
            pass
 | 
						|
 | 
						|
    tc = TestClass()
 | 
						|
    tc._pre_setup()
 | 
						|
    tc.setUpClass()
 | 
						|
 | 
						|
    with pytest.warns(PendingDeprecationWarning):
 | 
						|
        tc._client = Client()
 | 
						|
 | 
						|
 | 
						|
def test_graphql_test_case_imports_endpoint():
 | 
						|
    """
 | 
						|
    GraphQLTestCase class should import the default endpoint from settings file
 | 
						|
    """
 | 
						|
 | 
						|
    assert GraphQLTestCase.GRAPHQL_URL == graphene_settings.TESTING_ENDPOINT
 |