From 6b8a5506de82388adb056bc7cf12290fdd4234ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Wed, 30 Dec 2020 06:29:49 +0300 Subject: [PATCH] Add test for pending deprecation warning on GraphQLTestCase._client --- graphene_django/utils/tests/test_testing.py | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 graphene_django/utils/tests/test_testing.py diff --git a/graphene_django/utils/tests/test_testing.py b/graphene_django/utils/tests/test_testing.py new file mode 100644 index 0000000..df78321 --- /dev/null +++ b/graphene_django/utils/tests/test_testing.py @@ -0,0 +1,24 @@ +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