Changeset 6609
- Timestamp:
- 14 Aug 2011, 15:04:26 (13 years ago)
- 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 157 157 We have to go to one of the login pages first: 158 158 159 >>> browser.open('http://localhost/app/@@loginstaff') 159 >>> browser.open('http://localhost/app') 160 >>> browser.getLink('Staff Login').click() 160 161 >>> print browser.headers['Status'] 161 162 200 Ok … … 170 171 171 172 We 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 172 179 173 180 >>> browser.getControl(name='form.login').value = 'bob' -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r6608 r6609 10 10 11 11 We can watch universities in the browser. 12 13 To make sure, we can 'watch' pages, we first have to initialize out14 test browser::15 16 >>> from zope.testbrowser.testing import Browser17 >>> browser = Browser()18 >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')19 >>> browser.handleErrors = False20 12 21 13 We create an university object and put into the ZODB root:: … … 34 26 >>> setSite(root['myuniversity']) 35 27 28 To make sure, we can 'watch' pages, we first have to initialize out 29 test browser:: 30 31 >>> from zope.testbrowser.testing import Browser 32 >>> browser = Browser() 33 36 34 Let's get the default view of a university:: 37 35 … … 42 40 ... 43 41 44 We can also get an edit view of a university:: 42 The 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 52 Now we login as manager:: 53 54 >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw') 55 >>> browser.handleErrors = False 56 57 We can then get an edit view of a university:: 45 58 46 59 >>> browser.open('http://localhost/myuniversity/manage') … … 187 200 188 201 Now we fill the form properly (this will send a real message to 189 contact@waeup.org): 202 contact@waeup.org):: 190 203 191 204 >>> browser.open('http://localhost/myuniversity/contactadmin') … … 386 399 ... 387 400 388 We can view a department by browsing a URL like this: 401 We can view a department by browsing a URL like this:: 389 402 390 403 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD') 391 404 392 Afterwards, the department should be visible: 405 Afterwards, the department should be visible:: 393 406 394 407 >>> browser.open('http://localhost/myuniversity/faculties/TF')
Note: See TracChangeset for help on using the changeset viewer.