graphene-django/graphene_django/tests/test_command.py

11 lines
407 B
Python
Raw Normal View History

from django.core import management
from mock import patch
from six import StringIO
2018-07-20 02:51:33 +03:00
@patch("graphene_django.management.commands.graphql_schema.Command.save_file")
def test_generate_file_on_call_graphql_schema(savefile_mock, settings):
out = StringIO()
2018-07-20 02:51:33 +03:00
management.call_command("graphql_schema", schema="", stdout=out)
assert "Successfully dumped GraphQL schema to schema.json" in out.getvalue()