I've just switched my ftests from twill+mechanize+... (too complex for 
my taste) to testutil.BrowsinSession.

It seems BrowsingSession does not follow redirects, like the previous 
setup did.
So, I have to manually call the new URL from the test methods..

I tried naively fixing the issue in my testcase class:


> class BrowserTest(DBTestCase):
>     def setUp(self):
>         super(BrowserTest, self).setUp()
>         self.browser = BrowsingSession()
> 
>     def go(self, *args, **kw):
>         try:
>             self.browser.goto(*args, **kw)
>             if self.response.startswith('This resource resides temporarily at 
> '):
>                 new_url = BeautifulSoup(self.response)('a')[0].get('href')
>                 self.browser.goto(new_url)
>         finally:
>             if not self.response:
>                 raise self.failureException('page is not there')


And cherrypy complains.

Traceback (most recent call last):
   File 
"/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cphttptools.py",
 
line 105, in _run
     self.main()
   File 
"/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy/_cphttptools.py",
 
line 254, in main
     body = page_handler(*virtual_path, **self.params)
TypeError: _wrapper() keywords must be strings


How do you cope with redirects?

tnx

--~--~---------~--~----~------------~-------~--~----~
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