Changeset 4336


Ignore:
Timestamp:
22 Jun 2009, 15:29:18 (15 years ago)
Author:
uli
Message:

Update tests (test new importer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/browser.txt

    r4330 r4336  
    247247  >>> browser.getControl(name='SUBMIT').click()
    248248
     249We 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
    249263
    250264Importing a CSV file
     
    328342  ...
    329343
     344We 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  ...
    330354
    331355Clean up:
Note: See TracChangeset for help on using the changeset viewer.