Ugly fix to make the LoginRequiredMiddleware test case work correctly.