Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

APIRequestFactory() returns a WSGIRequest#9654

Unanswered
paulwispnext asked this question inPotential Issue
Discussion options

Well as per title, APIRequestFactory() returns a WSGI request object. This means that it doesn't have a.data attribute.

The quick solution that google shows is to wrap it in aRequest object. However if we do something like:

factory = APIRequestFactory()request = factory.post('', {'title': 'new idea'})  # no path is relevant, we do not use it in our tests, just the data.drf_request = Request(request)print(drf_request.data)

We get the following error:
raise exceptions.UnsupportedMediaType(media_type)

And debugging shows that the parsers (list) is empty.

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
1 participant
@paulwispnext

[8]ページ先頭

©2009-2025 Movatter.jp