diff options
| author | Tim Graham <timograham@gmail.com> | 2014-04-28 18:41:16 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-04-28 18:41:36 -0400 |
| commit | aabceadd7d7a61468b0dc7dc9d560a770abae0cf (patch) | |
| tree | bf8997b7ecdb1e2c72b8a8db1d90eb20be53fc56 /django | |
| parent | 26b03f25265227498a2559af807918fe2a1d246f (diff) | |
Revert "Fixed #15179 -- middlewares not applied for test client login()"
This reverts commit 4fdd51b73240bf9c8d9472fcc45df699f0714755.
See the ticket for concerns with this implementation; it will be revisited.
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/client.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/django/test/client.py b/django/test/client.py index e6a9593dfd..9513dcd809 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -15,7 +15,7 @@ from django.core.handlers.wsgi import WSGIRequest from django.core.signals import (request_started, request_finished, got_request_exception) from django.db import close_old_connections -from django.http import SimpleCookie, QueryDict +from django.http import SimpleCookie, HttpRequest, QueryDict from django.template import TemplateDoesNotExist from django.test import signals from django.utils.functional import curry @@ -553,8 +553,8 @@ class Client(RequestFactory): apps.is_installed('django.contrib.sessions')): engine = import_module(settings.SESSION_ENGINE) - # Create a fake request that goes through request middleware - request = self.request().wsgi_request + # Create a fake request to store login details. + request = HttpRequest() if self.session: request.session = self.session @@ -588,9 +588,8 @@ class Client(RequestFactory): Causes the authenticated user to be logged out. """ from django.contrib.auth import get_user_model, logout - # Create a fake request that goes through request middleware - request = self.request().wsgi_request + request = HttpRequest() engine = import_module(settings.SESSION_ENGINE) UserModel = get_user_model() if self.session: |
