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

Eli Carter eli.carter at commprove.com
Fri Aug 24 08:33:50 PDT 2007

On Wednesday 22 August 2007, Titus Brown wrote:
> On Wed, Aug 22, 2007 at 03:27:03PM -0500, Eli Carter wrote:
> -> With -latest, the find("logged in as %s" % username), is looking at a 
> -> consisting of 'Redirecting...' [2].
> -> 
> -> What am I doing wrong here?
> Hi, Eli,
> what's going on with the HTTP codes?  Can you send me the results of
> 'debug http 1'?

Sorry for the delay getting back to you on this.

I reduced the set of tests to one failing test.[1]
I patched twill-latest to display the content of the page when .find() 
(or .notfind()) fails.[2]
I called twill.commands.debug('http', 1) shortly before the problematic part.
The output from that is attached.

The testcase adds auth for 'user' (it had previously added auth for 'admin'), 
goes to http://localhost:port, follows the 'Login' link, and expects to be 
redirected back to http://localhost:port, where it will find the 
string "logged in as user".  Instead, what I'm seeing is the new page 
consists of "Redirecting...".

This worked as I expected in 0.9b1.

Any pointers to what I'm doing wrong would be appreciated.



[1] RegressionTestTicket4630a
[2] against twill-latest
--- twill-latest/twill/commands.py	2007-08-22 03:05:09.000000000 -0500
+++ twill-latest.ejc/twill/commands.py	2007-08-24 09:53:28.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)
@@ -251,7 +251,7 @@
     page = browser.get_html()
     if regexp.search(page):
-        raise TwillAssertionError("match to '%s'" % (what,))
+        raise TwillAssertionError("match to '%s'" % (what,), page)
 def back():
[3] tc.debug('http', 1) just before this line: 
and tc.debug('http', 0) just after that line.  And only for the failing case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redirecting-problem.log
Type: text/x-log
Size: 5794 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/twill/attachments/20070824/a771a206/attachment.bin 

More information about the twill mailing list