我有一个 POST View ,它还从 URL 获取 GET 参数 ?company=
。如何使用 Django Rest Framework 测试工具进行测试?
最佳答案
不知道,可以更改 GET 和 POST 属性:
request = APIRequestFactory().post('', data={}, format='json')
request.GET = {'company': 1}
关于python - 如何测试 POST 请求的 URL 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55908544/