﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35851	django.test.client.ClientMixin._login doest not set enviorn like REMOTE_ADDR can cause test failures in certain situations	elonzh		"Our service listens for the ''user_logged_in'' signal to log the user's IP information, but when using ''TestClient.login/force_login'', the absence of ''REMOTE_ADDR'' results in an error. 

By reviewing the source code, I found that ''TestClient.login/force_login''(https://github.com/django/django/blob/main/django/test/client.py#L869-L882) creates an empty HttpRequest, which behaves differently from ''django.test.client.Client.request''(https://github.com/django/django/blob/main/django/test/client.py#L401-L436). 

Therefore, I believe this is an issue that needs to be addressed.

----

I'd like to create a patch if this ticket is confirmed."	New feature	closed	Testing framework	dev	Normal	wontfix		elonzh	Unreviewed	0	0	0	0	0	0
