On May 10, 2011, at 12:35 AM, steve wrote:

> how do i set the acceptance header?  i tried searching for it, but
> couldn't find anything.  is it in the TestApp's constructor as an
> extra_environ?  if so, what's the key?

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

 
According to the webtest-docs, these can be set through the headers-parameter 
that also can be passed to the follow-call (and get/post of course). But you 
might also consider taking a look at webtest's source to see if there is a 
request-spanning way to do that.

Diez

> 
> thanks.
> 
> 
> On May 8, 6:50 am, "Diez B. Roggisch" <[email protected]> wrote:
>> On iPhone, thus a short answer: can you try setting the acceptance header on 
>> the testapp? That might help.
>> 
>> Diez
>> 
>> Am 08.05.2011 um 05:53 schrieb steve <[email protected]>:
>> 
>>> hi,
>> 
>>> i have a problem with content type when testing.  my controller has
>>> the following:
>> 
>>> @expose("addressbook.templates.contacts.get_all")
>>> @expose(content_type="text/x-vcard")  # i set the extension
>>> to .vcard/.vcf
>> 
>>> anyway, this is all good until i start writing functional tests.  for
>>> some reason, when i run app.get(...), it always return in vcard
>>> format.  i could work around this with app.get(get_all.html) and get
>>> it in html for get_all and get_one.  but when i test post and it
>>> redirects to get_one after a successful insert, it will be in vcard
>>> format again.
>> 
>>> is there a way for me to set the default/priority of content type?  or
>>> is there a way for me to tell response.follow() to use text/html
>>> instead of text/vcard?
>> 
>>> many thanks,
>>> steve
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "TurboGears" 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 
>>> athttp://groups.google.com/group/turbogears?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TurboGears" 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/turbogears?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to