Thanks RequestFactory does exactly what I needed it is a pity that I
had ignored it while going through the docs.

There is however one question I have is it possible to check what
template was used to render the content. The assertTemplateUsed()
method looks for a response.templates attribute that does not exist as
part of the response returned from the view. response.template (please
note the lack of the 's' at the end) is also a deprecated feature and
the django source says that response.templates should be used instead.

I cannot think of any other way to check what template was rendered
and wondered if you have any pointers in this respect.

Thanks once again.

Yours sincerely,
nav

On Nov 8, 8:39 pm, Flavia Missi <flaviami...@gmail.com> wrote:
> When I need something like you want, I usually use RequestFactory to create
> the request and call the view directly.
>
> You can see an example herehttps://gist.github.com/1348085
>
> Hope that helps ;)
>
> []'s
>
>
>
>
>
>
>
>
>
> On Tue, Nov 8, 2011 at 12:21 PM, nav <navanitach...@gmail.com> wrote:
> > Dear Folks,
>
> > While testing my application I found out that the middleware that
> > implements process_request is not run. This is fine as long as I can
> > add the required field to the request object before passing the
> > required URL to self.client.get().
>
> > what I want to do is something like this
>
> > request.field = 'some value'
> > self.client.get(url)
> > assertsomething()
>
> > The variable field is checked for in the views and does some
> > processing based on that. What would be the best way to add this field
> > to the request sent by self.client.get().
>
> > Thanks,
>
> > Yours sincerely,
> > nav
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.> To post to this group, send email 
> > todjango-us...@googlegroups.com.
> > To unsubscribe from this group, send email 
> > to>django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Flávia Missi
> @flaviamissi <http://twitter.com/flaviamissi>
> flaviamissi.com.brhttps://github.com/flaviamissi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to