Ignore:
Timestamp:
13 Jun 2009, 12:00:22 (15 years ago)
Author:
uli
Message:

Test import of faculty CSV files.

File:
1 edited

Legend:

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

    r4275 r4276  
    157157  >>> os.listdir(uploadpath)
    158158  []
     159
     160
     161Uploading files
     162---------------
    159163
    160164Now we can upload files. Most interesting files might be CSV files,
     
    195199  ['myfaculties.csv']
    196200
     201
     202Importing a CSV file
     203--------------------
     204
     205As the uploaded file conforms with what we expect from a faculty-CSV
     206file, we can import it. To do this we click the ``Import CSV data``
     207link:
     208
     209  >>> browser.open('http://localhost/myuniversity/datacenter')
     210  >>> browser.getLink('Import CSV data').click()
     211
     212Here we get all importable files listed:
     213
     214  >>> print browser.contents
     215  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     216  ...The following files are available for import:...
     217  ...myfaculties.csv...
     218  ...Faculty Importer...
     219  ...
     220
     221As we can see, the files are analyzed on-the-fly so the system can
     222tell us what kind of importer is available for each.
     223
     224We do import the faculty file by clicking on ``Import!``:
     225
     226  >>> facimport = browser.getControl('Import!')
     227  >>> facimport.click()
     228
     229  >>> print browser.contents
     230  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     231  ...Successfully imported: myfaculties.csv...
     232  ...
     233
     234We just created two new faculties:
     235
     236  >>> browser.open('http://localhost/myuniversity/faculties/')
     237  >>> print browser.contents
     238  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     239  ...<h2>Registered faculties:</h2>...
     240  ...Arts...
     241  ...Sciences...
     242  ...
     243
    197244Clean up:
    198245
Note: See TracChangeset for help on using the changeset viewer.