【发布时间】:2021-09-14 02:17:22
【问题描述】:
导入 json
从 graphene_django.utils.testing 导入 GraphQLTestCase
从 swapi.schema 导入架构
类 FirstTestCase(GraphQLTestCase): 固定装置 = ['app/fixtures/unittest.json'] GRAPHQL_SCHEMA = 架构
def test_people_query(self):
response = self.query(
'''
query{
allPlanets {
edges{
node{
id
name
}
}
}
}
''',
)
self.assertResponseNoErrors(response)
content = json.loads(response.content)
self.assertEqual(len(content['data']['allPlanets']['edges']), 61)
def test_two(self):
# Some test logic
pass
我有上面的代码,我只需要运行test_two。我已经知道这个命令 python manage.py test 运行所有测试。请帮忙提前谢谢
【问题讨论】:
标签: graphql graphene-python graphene-django