[twill] Redirecting... twill-latest vs twill-0.9b1

Eli Carter eli.carter at commprove.com
Wed Aug 22 13:27:03 PDT 2007


All,

I'm trying to use twill-latest with a set of tests[1] that I had working with 
twill-0.9b1.  It appears that twill's behavior in the face of redirects has 
changed.

            tc.add_auth("", self.url, username, username)
            tc.url(self.url)
            tc.find("Login")
            tc.follow("Login")
            # We've provided authentication info earlier, so this should
            # redirect back to the base url.
            tc.find("logged in as %s" % username)
            tc.find("Logout")
            tc.url(self.url)
            tc.notfind(internal_error)

This worked with 0.9b1.
With -latest, the find("logged in as %s" % username), is looking at a page 
consisting of 'Redirecting...' [2].

What am I doing wrong here?

Eli

[1] For those who care, 
http://trac.edgewall.org/browser/sandbox/testing/trac/tests/functional.py#L195

[2] As can be seen if you apply the following patch:
diff -urN --exclude='*.pyc' twill-latest/twill/commands.py 
twill-latest.ejc/twill/commands.py
--- twill-latest/twill/commands.py	2007-08-22 03:05:09.000000000 -0500
+++ twill-latest.ejc/twill/commands.py	2007-08-22 15:01:53.000000000 -0500
@@ -231,7 +231,7 @@
 
     m = regexp.search(page)
     if not m:
-        raise TwillAssertionError("no match to '%s'" % (what,))
+        raise TwillAssertionError("no match to '%s'" % (what,), page)
 
     if m.groups():
         match_str = m.group(1)





More information about the twill mailing list