Changeset 4336 for waeup/branches/ulif-rewrite/src
- Timestamp:
- 22 Jun 2009, 15:29:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/browser.txt
r4330 r4336 247 247 >>> browser.getControl(name='SUBMIT').click() 248 248 249 We create and upload also a CSV file containing certificate courses: 250 251 >>> open('certcourses.csv', 'wb').write( 252 ... """code,faculty_code,department_code,certificate_code,level,core_or_elective 253 ... LI1,FA,LIT,LBA,100,True 254 ... LI2,FA,LIT,LBA,200,True 255 ... """) 256 257 >>> browser.open('http://localhost/myuniversity/datacenter/upload') 258 >>> browser.getControl(name='uploadfile:file').add_file( 259 ... cStringIO.StringIO(open('certcourses.csv', 'rb').read()), 260 ... 'text/plain', 'mycertcourses.csv') 261 >>> browser.getControl(name='SUBMIT').click() 262 249 263 250 264 Importing a CSV file … … 328 342 ... 329 343 344 We can also import certificate courses: 345 346 >>> browser.open('http://localhost/myuniversity/datacenter') 347 >>> browser.getLink('Import CSV data').click() 348 >>> browser.getControl('Import!', index=4).click() 349 350 >>> print browser.contents 351 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 352 ...Successfully imported: mycertcourses.csv... 353 ... 330 354 331 355 Clean up:
Note: See TracChangeset for help on using the changeset viewer.