Appending middleware bypasses any additional middlewares that might be setup

Issue #9 resolved
created an issue


We have a middleware which checks additional items on request.user.

django_webtest.backends.WebtestUserBackend gets appended to the list of settings.MIDDLEWARE_CLASSES, which means that the request user doesn't get setup 'til after our middleware has already run (or hasn't because it bails out).

The WebtestUserBackend has a dependency on django.contrib.auth.middleware.AuthenticationMiddleware...

I've attached a patch which changes the behaviour, rather than adding the django_webtest middleware to the end of the MIDDLEWARE_CLASSES it inserts it after the required AuthenticationMiddleware.