Changeset 6609


Ignore:
Timestamp:
14 Aug 2011, 15:04:26 (13 years ago)
Author:
Henrik Bettermann
Message:

Increase test coverage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/authentication.txt

    r6203 r6609  
    157157We have to go to one of the login pages first:
    158158
    159   >>> browser.open('http://localhost/app/@@loginstaff')
     159  >>> browser.open('http://localhost/app')
     160  >>> browser.getLink('Staff Login').click()
    160161  >>> print browser.headers['Status']
    161162  200 Ok
     
    170171
    171172We use this form:
     173
     174  >>> browser.getControl(name='form.login').value = 'bob'
     175  >>> browser.getControl(name='form.password').value = 'invalidpw'
     176  >>> browser.getControl('Login').click()
     177  >>> 'You entered wrong credentials' in browser.contents
     178  True
    172179
    173180  >>> browser.getControl(name='form.login').value = 'bob'
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r6608 r6609  
    1010
    1111We can watch universities in the browser.
    12 
    13 To make sure, we can 'watch' pages, we first have to initialize out
    14 test browser::
    15 
    16   >>> from zope.testbrowser.testing import Browser
    17   >>> browser = Browser()
    18   >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    19   >>> browser.handleErrors = False
    2012
    2113We create an university object and put into the ZODB root::
     
    3426  >>> setSite(root['myuniversity'])
    3527
     28To make sure, we can 'watch' pages, we first have to initialize out
     29test browser::
     30
     31  >>> from zope.testbrowser.testing import Browser
     32  >>> browser = Browser()
     33
    3634Let's get the default view of a university::
    3735
     
    4240  ...
    4341
    44 We can also get an edit view of a university::
     42The contact form for anonymous users is called 'Enquiries'::
     43
     44  >>> browser.open('http://localhost/myuniversity')
     45  >>> browser.getLink('Enquiries').click()
     46  >>> browser.getControl('Submit').click()
     47  >>> print browser.contents
     48  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     49  ...Error: All fields must be filled...
     50  ...
     51
     52Now we login as manager::
     53
     54  >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     55  >>> browser.handleErrors = False
     56
     57We can then get an edit view of a university::
    4558
    4659  >>> browser.open('http://localhost/myuniversity/manage')
     
    187200
    188201Now we fill the form properly (this will send a real message to
    189 contact@waeup.org):
     202contact@waeup.org)::
    190203
    191204  >>> browser.open('http://localhost/myuniversity/contactadmin')
     
    386399  ...
    387400
    388 We can view a department by browsing a URL like this:
     401We can view a department by browsing a URL like this::
    389402
    390403  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
    391404
    392 Afterwards, the department should be visible:
     405Afterwards, the department should be visible::
    393406
    394407  >>> browser.open('http://localhost/myuniversity/faculties/TF')
Note: See TracChangeset for help on using the changeset viewer.