#32929: AsyncRequestFactory.get() ignores data parameter
-------------------------------------+-------------------------------------
Reporter: Pochang Lee | Owner: Pochang
| Lee
Type: Bug | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: AsyncTestClient, | Triage Stage: Accepted
AsyncRequestFactory |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* cc: Andrew Godwin, Carlton Gibson (added)
* stage: Unreviewed => Accepted
Comment:
Thanks for the report, good catch. I think the following should do the
trick:
{{{
diff --git a/django/test/client.py b/django/test/client.py
index 4a0b6b45f4..b4c091aa5c 100644
--- a/django/test/client.py
+++ b/django/test/client.py
@@ -547,6 +547,8 @@ class AsyncRequestFactory(RequestFactory):
follow = extra.pop('follow', None)
if follow is not None:
s['follow'] = follow
+ if query_string := extra.pop('QUERY_STRING', None):
+ s['query_string'] = query_string
s['headers'] += [
(key.lower().encode('ascii'), value.encode('latin1'))
for key, value in extra.items()
}}}
Would you like to prepare a patch? (tests are also required).
--
Ticket URL: <https://code.djangoproject.com/ticket/32929#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.e3dab34528e5b6c9203877f4ee042653%40djangoproject.com.