, **kwargs): post_request = json.loads(request.POST) print语句打印一个QueryDict,json.loads继续失败,并显示以下信息: TypeError: the JSON object must be str, bytes or bytearray, not QueryDict
现在,将一个普通的dict作为数据参数传递就可以了:ser.is_valid(raise_exception=True)from django.http import QueryDict
ser = ParentSerializer(data=QueryDict但是,在测试期间,使用类似client.post('url', da