Changeset 4330
- Timestamp:
- 21 Jun 2009, 01:07:34 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/browser.txt
r4278 r4330 232 232 >>> browser.getControl(name='SUBMIT').click() 233 233 234 We create and upload also a CSV file containing certificates: 235 236 >>> open('certificates.csv', 'wb').write( 237 ... """code,title,faculty_code,department_code,category,study_mode,end_level,m_prefix,max_pass,start_level,application_category 238 ... LBA,BACHELOR OF LITERATURE,FA,LIT,UG,ug_ft,500,LIT,30,100,basic 239 ... LMA,MASTER OF LITERATURE,FA,LIT,UG,ug_pt,500,LIT,30,100,cest 240 ... DME,DIPLOMA OF MATH,FS,MAT,DP,dp_ft,200,DME,30,100,cest 241 ... """) 242 243 >>> browser.open('http://localhost/myuniversity/datacenter/upload') 244 >>> browser.getControl(name='uploadfile:file').add_file( 245 ... cStringIO.StringIO(open('certificates.csv', 'rb').read()), 246 ... 'text/plain', 'mycertificates.csv') 247 >>> browser.getControl(name='SUBMIT').click() 234 248 235 249 … … 303 317 ... 304 318 319 We can also import the certificate data: 320 321 >>> browser.open('http://localhost/myuniversity/datacenter') 322 >>> browser.getLink('Import CSV data').click() 323 >>> browser.getControl('Import!', index=3).click() 324 325 >>> print browser.contents 326 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 327 ...Successfully imported: mycertificates.csv... 328 ... 329 305 330 306 331 Clean up:
Note: See TracChangeset for help on using the changeset viewer.