Opened 3 years ago
Closed 3 years ago
#32929 closed Bug (fixed)
AsyncRequestFactory.get() ignores data parameter
Reported by: | Pochang Lee | Owned by: | Pochang Lee |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | AsyncTestClient, AsyncRequestFactory |
Cc: | Andrew Godwin, Carlton Gibson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When passing data to AsyncRequestFactory.get(),
the resulting request.GET always gives an empty QueryDict
>>> request_factory = AsyncRequestFactory() >>> request = request_factory.get('/somewhere/', {'var': '100'}) >>> request.GET <QueryDict: {}>
while in synchronous
>>> request_factory = RequestFactory() >>> request = request_factory.get('/somewhere/', {'var': '100'}) >>> request.GET <QueryDict: {'var': ['100']}>
This also prevents AsyncClient.get() from passing GET parameters to view function.
Change History (5)
comment:1 by , 3 years ago
Version: | 3.2 → dev |
---|
follow-up: 3 comment:2 by , 3 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 3 years ago
Has patch: | set |
---|
Replying to Mariusz Felisiak:
Would you like to prepare a patch? (tests are also required).
Yes, I have submitted a pull request.
comment:4 by , 3 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
Thanks for the report, good catch. I think the following should do the trick:
Would you like to prepare a patch? (tests are also required).