Changeset 1482:c77dea3e745a

Show
Ignore:
Timestamp:
08/26/08 17:07:44 (3 months ago)
Author:
Greg Von Kuster <greg@bx.psu.edu>
branch:
default
Message:

Fix for new twill version 0.9.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test/base/twilltestcase.py

    r1451 r1482  
    88import twill 
    99import twill.commands as tc 
    10 from twill.other_packages import ClientForm 
     10from twill.other_packages._mechanize_dist import ClientForm 
    1111from elementtree import ElementTree 
    1212 
     
    411411        """Populates and submits a form from the keyword arguments""" 
    412412        #Check for onchange attribute, submit a change if required 
    413         for i, control in enumerate(tc.showforms()[form-1].controls): 
     413        for i, f in enumerate( tc.showforms() ): 
     414            if i == form - 1: 
     415                break    
     416        for i, control in enumerate( f.controls ): 
    414417            try: 
    415418                if 'refresh_on_change' in control.attrs.keys(): 
     
    457460                value = [ value ] 
    458461 
    459             for i, control in enumerate(tc.showforms()[form-1].controls): 
     462            for i, f in enumerate( tc.showforms() ): 
     463                if i == form - 1: 
     464                    break    
     465            for i, control in enumerate( f.controls ): 
    460466                if control.name == key: 
    461467                    control.clear()