Changeset 4373


Ignore:
Timestamp:
27 Jun 2009, 11:39:35 (16 years ago)
Author:
uli
Message:

Add basic functional tests for departments.

File:
1 edited

Legend:

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

    r4336 r4373  
    108108  ...
    109109
     110Departments
     111===========
     112
     113Departments are stored in :class:`IFaculty` instances with their code
     114as key. Faculties therefore are also department containers. Faculties
     115provides an add-form to add new departments:
     116
     117  >>> browser.open('http://localhost/myuniversity/faculties/TF/add')
     118  >>> print browser.contents
     119  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     120  ...<span class="required">*</span><span>Name of Department</span>
     121  ...
     122
     123We fill in a new name for our new faculty::
     124
     125  >>> ctrl = browser.getControl(name='form.title')
     126  >>> ctrl.value = 'TestDept'
     127
     128Furthermore we add a code (kind of abbreviation):
     129
     130  >>> browser.getControl(name='form.code').value = 'TD'
     131
     132Finally we click on 'Add Department' to add the new thing::
     133
     134  >>> browser.getControl('Add department').click()
     135
     136We can view a department by browsing a URL like this::
     137
     138  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
     139
     140Afterwards, the department should be visible:
     141
     142  >>> browser.open('http://localhost/myuniversity/faculties/TF')
     143  >>> print browser.contents
     144  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     145  ...<h2>Registered Departments:</h2>
     146  ...<a href="http://localhost/myuniversity/faculties/TF/TD">TestDept</a>
     147  ...
    110148
    111149Data Center
Note: See TracChangeset for help on using the changeset viewer.