mirror of
https://github.com/graphql-python/graphene.git
synced 2024-09-22 03:49:02 +03:00
44 lines
935 B
Python
44 lines
935 B
Python
# import pytest
|
|
# from graphql.core import graphql
|
|
|
|
# from .models import *
|
|
# from .schema import schema
|
|
# from .data import initialize, getFaction
|
|
|
|
# pytestmark = pytest.mark.django_db
|
|
|
|
# def test_correct_fetch_first_ship_rebels():
|
|
# initialize()
|
|
# print schema.Faction._meta.fields_map
|
|
# query = '''
|
|
# query RebelsShipsQuery {
|
|
# rebels {
|
|
# name,
|
|
# ships(first: 1) {
|
|
# edges {
|
|
# node {
|
|
# name
|
|
# }
|
|
# }
|
|
# }
|
|
# }
|
|
# }
|
|
# '''
|
|
# expected = {
|
|
# 'rebels': {
|
|
# 'name': 'Alliance to Restore the Republic',
|
|
# 'ships': {
|
|
# 'edges': [
|
|
# {
|
|
# 'node': {
|
|
# 'name': 'X-Wing'
|
|
# }
|
|
# }
|
|
# ]
|
|
# }
|
|
# }
|
|
# }
|
|
# result = schema.execute(query)
|
|
# assert not result.errors
|
|
# assert result.data == expected
|