﻿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
15142	Contrib tests throwing errors on bare project when cache middleware enabled and cache specified	Jim Dalton	nobody	"I ran into an issue recently where the contrib tests were throwing multiple errors during a test run when cache middleware was enabled and a cache was specified.

This is exactly the behavior described in this Stack Overflow question: http://stackoverflow.com/questions/3219668/using-django-cache-middleware-causes-contrib-auth-unit-tests-to-fail

Here is a description of the setup and the steps to reproduce the problem (taken from that question):

My Middleware:

{{{
MIDDLEWARE_CLASSES = (
    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
)
}}}

All my test failures look like the one below:

{{{
======================================================================
Error: test_last_login (django.contrib.auth.tests.remote_user.RemoteUserTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""C:\Python26\lib\site-packages\django\contrib\auth\tests\remote_user.py"",
 line 87, in test_last_login
    self.assertNotEqual(default_login, response.context['user'].last_login)
TypeError: 'NoneType' object is unsubscriptable
}}}

Steps to Reproduce:

 1. Start a new django project (django-admin.py startproject myproject) and configure settings.py
 2. Add CACHE_BACKEND to settings.py and add the two Cache Middlewares from Django
 3. Run python manage.py test

I have an idea as to the cause and a proposed patch to resolve this, but I will add it with a separate comment to keep the description of the issue clean here."		closed	Contrib apps	dev		fixed			Ready for checkin	1	0	0	0	0	0
