I have added a ticket with a patch

http://code.djangoproject.com/ticket/9159

On Sep 20, 11:27 am, HenrikV <[EMAIL PROTECTED]> wrote:
> The testing client is great for testing the whole request chain. It
> doesn't seem to support
> testing of middleware very well though. I think it should be improved
> to support two approaches:
>
> 1) Directly calling the middleware functions passing a request and
> response.
> 2) Calling the middleware as part of the stack, testing the
> modifications to request and response.
>
> In the first case there seems to be no easy way to create a request,
> response pair. An extra method on the
> client should do the trick.
>
> In the second case the WSGIRequest object isn't available. What would
> be the better api? To have the request
> be an optional parameter to get/post, or to have more finegrained
> methods that isolate the steps of the request,
> such as:
>
> c = Client()
> request,response = c.pre_view_get('/')
> response = c.call_view(request,response)
> response = c.post_view(response)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to