#NEWLINE# def _setup_auth_middleware( self ) : #NEWLINE# #INDENT# webtest_auth_middleware = 'django_webtest.middleware.WebtestUserMiddleware' #NEWLINE# django_auth_middleware = 'django.contrib.auth.middleware.AuthenticationMiddleware' #NEWLINE# if ( django_auth_middleware not in settings . MIDDLEWARE_CLASSES ) : #NEWLINE# #INDENT# settings . MIDDLEWARE_CLASSES . append ( webtest_auth_middleware ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# index = settings . MIDDLEWARE_CLASSES . index ( django_auth_middleware ) #NEWLINE# settings . MIDDLEWARE_CLASSES . insert ( ( index + 1 ) , webtest_auth_middleware )