source: waeup/branches/uli-cleanup/src/waeup/browser.txt @ 3539

Last change on this file since 3539 was 3539, checked in by uli, 16 years ago

Fix browser tests.

  • Property svn:eol-style set to native
File size: 1.1 KB
RevLine 
[3523]1The waeup package
[3521]2********************
3
4:Test-Layer: functional
5
6University
7==========
8
9We can watch universities in the browser.
10
11To make sure, we can 'watch' pages, we first have to initialize out
12test browser::
13
14  >>> from zope.testbrowser.testing import Browser
15  >>> browser = Browser()
16  >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
17  >>> browser.handleErrors = False
18
19We create an university object and put into the ZODB root::
20
21  >>> root = getRootFolder()
22  >>> list(root)
23  []
24
[3523]25  >>> from waeup.app import University
[3521]26  >>> u = University()
27  >>> root['myuniversity'] = u
28  >>> list(root)
29  [u'myuniversity']
30
31
32Let's get the default view of a university::
33
34  >>> browser.open('http://localhost/myuniversity')
35  >>> print browser.contents
[3539]36  <!DOCTYPE html ...
[3521]37  ...<h1>Congratulations!</h1>...
38  ...
39
40We can also get an edit view of a university::
41
42  >>> browser.open('http://localhost/myuniversity/edit')
43  >>> print browser.contents
44  <html>...
45  ...<form action="http://localhost/myuniversity/edit"
46  ...
47
48The edit form contains the default value for the university name::
49
50  >>> 'Unnamed' in browser.contents
51  True
52
Note: See TracBrowser for help on using the repository browser.