WSGI environ variables not set for test client's login() request
|Reported by:||tim.dawborn@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The fake HttpRequest object created in the test client's login() method does not contain any of the minimum set of WSGI environ variables defined in RequestFactory._base_environ. This becomes an issue when you have a signal receiver listening to auth.signals.user_logged_in and expecting a valid-looking request object to exist.
The specific issue I've got is that REMOTE_ADDR does not exist.
Is this a bug, or is there a reason I'm missing as to why this request object isn't valid.
Change History (3)
comment:1 Changed 3 years ago by bmispelon
- Cc bmispelon@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted