def setUp(self):
    self.curr_middleware = settings.MIDDLEWARE_CLASSES
    self.curr_auth = settings.AUTHENTICATION_BACKENDS
    settings.MIDDLEWARE_CLASSES += (self.middleware,)
    settings.AUTHENTICATION_BACKENDS += (self.backend,)
def setUp(self):
    self.curr_middleware = settings.MIDDLEWARE_CLASSES
    self.curr_auth = settings.AUTHENTICATION_BACKENDS
    settings.MIDDLEWARE_CLASSES += (self.middleware,)
    settings.AUTHENTICATION_BACKENDS += (self.backend,)