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 7836 django.test.client._session should check for session middleware instead Trevor Caira nobody "The django test client class allows you to use `self.client.session` only if you have `'django.contrib.sessions'` in your `INSTALLED_APPS` setting. That is, it assumes you are using sessions if and only if you have the sessions app installed. This assumption breaks down when you are using the sessions middleware independently of the sessions app, for instance if you are using a cache backend for sessions. I propose that `django.test.client._session` check for the sessions middleware class in `MIDDLEWARE_CLASSES` instead of the sessions app in `INSTALLED_APPS` to make it easier for people using the session middleware independently of the sessions app to use `self.client.sesssion` in tests." Bug closed Testing framework dev Normal fixed charette.s@… vlastimil@… unai@… Accepted 0 0 0 0 0 0