#35082: AsyncRequestFactory doesn't pass REMOTE_ADDR when set
---------------------------------------------+------------------------
Reporter: alex | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
I can describe this bug easily with an example:
{{{
from django.test import RequestFactory, AsyncRequestFactory
factory = RequestFactory()
afactory = AsyncRequestFactory()
request = factory.get("/customer/details", REMOTE_ADDR="127.0.1.1")
assert request.META["REMOTE_ADDR"] == "127.0.1.1"
request = afactory.get("/customer/details", REMOTE_ADDR="127.0.1.1")
# will fail
assert request.META["REMOTE_ADDR"] == "127.0.1.1"
}}}
I think there are some other variables also affected. I tested it only
with django 5.0.
--
Ticket URL: <https://code.djangoproject.com/ticket/35082>
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/0107018ccd175c9c-c8b5a8e6-cf15-4fec-8031-2ca10ee8daac-000000%40eu-central-1.amazonses.com.