目前,我使用Fast GraphQL+草莓和pytest来测试graphql模式查询和突变。
但是当运行多个测试时,它会向我发送一个错误。
$ 'message': "'NoneType' object has no attribute 'send'",
用于conf测试的Python文件
import pytest
from src.graphql.db.session import get_session
from tests.graphql.db import overide_get_session
from fastapi
我目前正在为我的软件编写测试,但却陷入了困境。我尝试使用普通的GraphQL查询从我的数据库中获取数据,但我的端点首先要检查标题中的idToken是否有效。对于用户处理,我使用AWS认知,但找不到一个好的方式来模拟登录,以检索有效的令牌,以查询和变异数据在各个端点。
知道怎么处理这个案子吗?
下面是我来自石墨烯文档()的代码:
# Create a fixture using the graphql_query helper and `client` fixture from `pytest-django`.
import json
import pytest
from graphene_dj