mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-25 11:04:11 +03:00
40e5252936
* Use the Django Client test utility instance that Django provides with its TestCase class. This allows GraphQL tests to make use of the stateful client methods like login() * Add missing test case initializer call * Don't break backward compability * Add test for pending deprecation warning on GraphQLTestCase._client Co-authored-by: Tom Nightingale <tom@tnightingale.com>
25 lines
515 B
Python
25 lines
515 B
Python
import pytest
|
|
|
|
from .. import GraphQLTestCase
|
|
from ...tests.test_types import with_local_registry
|
|
|
|
|
|
@with_local_registry
|
|
def test_graphql_test_case_deprecated_client():
|
|
"""
|
|
Test that `GraphQLTestCase._client`'s 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
|