Ignore:
Timestamp:
13 Nov 2014, 16:54:17 (10 years ago)
Author:
Henrik Bettermann
Message:

Remove tools.

rename institution company.

Remove some apis from docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/browser.txt

    r11952 r11954  
    44Here we visit all parts of a Ikoba portal using a browser.
    55
    6 Institution
     6Company
    77==========
    88
    99We can watch universities in the browser.
    1010
    11 We create an institution object and put into the ZODB root::
     11We create an company object and put into the ZODB root::
    1212
    1313  >>> root = getRootFolder()
     
    1515  []
    1616
    17   >>> from waeup.ikoba.app import Institution
    18   >>> u = Institution()
    19   >>> root['myinstitution'] = u
     17  >>> from waeup.ikoba.app import Company
     18  >>> u = Company()
     19  >>> root['mycompany'] = u
    2020  >>> list(root)
    21   [u'myinstitution']
     21  [u'mycompany']
    2222
    2323  >>> from zope.component.hooks import setSite
    24   >>> setSite(root['myinstitution'])
     24  >>> setSite(root['mycompany'])
    2525
    2626To make sure, we can 'watch' pages, we first have to initialize out
     
    3030  >>> browser = Browser()
    3131
    32 Let's get the default view of a institution::
    33 
    34   >>> browser.open('http://localhost/myinstitution')
     32Let's get the default view of a company::
     33
     34  >>> browser.open('http://localhost/mycompany')
    3535  >>> print browser.contents
    3636  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    5555The contact form for anonymous users is called 'Enquiries'::
    5656
    57   >>> browser.open('http://localhost/myinstitution')
     57  >>> browser.open('http://localhost/mycompany')
    5858  >>> browser.getLink('Enquiries').click()
    5959  >>> browser.getControl('Send').click()
     
    7474Registered users with an email address can request a password change:
    7575
    76   >>> root['myinstitution']['users'].addUser('forgetful', 'secret',title='Bob Forgetful',
     76  >>> root['mycompany']['users'].addUser('forgetful', 'secret',title='Bob Forgetful',
    7777  ...                               description='A forgetful user', email='aa@aa.ng')
    78   >>> browser.open('http://localhost/myinstitution/changepw')
     78  >>> browser.open('http://localhost/mycompany/changepw')
    7979  >>> browser.getControl(name="form.identifier").value = 'forgetful'
    8080  >>> browser.getControl(name="form.email").value = 'aa@aa.ng'
     
    9191We can then get an edit view of the configuration container::
    9292
    93   >>> browser.open('http://localhost/myinstitution/configuration')
    94   >>> print browser.contents
    95   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    96   ...<form action="http://localhost/myinstitution/configuration/@@index"
    97   ...
    98 
    99 The edit form contains the default value for the institution name::
    100 
    101   >>> 'Sample Institution' in browser.contents
     93  >>> browser.open('http://localhost/mycompany/configuration')
     94  >>> print browser.contents
     95  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     96  ...<form action="http://localhost/mycompany/configuration/@@index"
     97  ...
     98
     99The edit form contains the default value for the company name::
     100
     101  >>> 'Sample Company' in browser.contents
    102102  True
    103103
     
    110110  ...
    111111
    112   >>> browser.open('http://localhost/myinstitution/configuration')
     112  >>> browser.open('http://localhost/mycompany/configuration')
    113113  >>> browser.getControl("Update plugins").click()
    114114  >>> print browser.contents
     
    120120and is properly rendered on the frontpage of the portal:
    121121
    122   >>> browser.open('http://localhost/myinstitution')
     122  >>> browser.open('http://localhost/mycompany')
    123123  >>> print browser.contents
    124124  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    134134If we change to German so that the German part of frontpage.rst is rendered:
    135135
    136   >>> browser.open('http://localhost/myinstitution//@@change_language?lang=de')
     136  >>> browser.open('http://localhost/mycompany//@@change_language?lang=de')
    137137  >>> print browser.contents
    138138  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    147147Switch back to English:
    148148
    149   >>> browser.open('http://localhost/myinstitution//@@change_language?lang=en')
     149  >>> browser.open('http://localhost/mycompany//@@change_language?lang=en')
    150150
    151151
     
    153153============
    154154
    155   >>> browser.open('http://localhost/myinstitution')
     155  >>> browser.open('http://localhost/mycompany')
    156156  >>> browser.getLink('Portal Users').click()
    157157  >>> print browser.contents
     
    187187manually by setting the roles attribute:
    188188
    189   >>> print root['myinstitution']['users']['bob'].roles
     189  >>> print root['mycompany']['users']['bob'].roles
    190190  []
    191   >>> root['myinstitution']['users']['bob'].roles = ['waeup.UsersManager']
    192   >>> print root['myinstitution']['users']['bob'].roles
     191  >>> root['mycompany']['users']['bob'].roles = ['waeup.UsersManager']
     192  >>> print root['mycompany']['users']['bob'].roles
    193193  ['waeup.UsersManager']
    194   >>> browser.open('http://localhost/myinstitution/users')
     194  >>> browser.open('http://localhost/mycompany/users')
    195195  >>> print browser.contents
    196196  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    200200Users can't be added twice:
    201201
    202   >>> browser.open('http://localhost/myinstitution/users/add')
     202  >>> browser.open('http://localhost/mycompany/users/add')
    203203  >>> browser.getControl(name="form.name").value = 'bob'
    204204  >>> browser.getControl(name="form.title").value = 'Bob The User'
     
    215215Users can be deleted:
    216216
    217   >>> browser.open('http://localhost/myinstitution/users')
     217  >>> browser.open('http://localhost/mycompany/users')
    218218  >>> browser.getControl("Remove", index=0).click()
    219219  >>> 'User account bob successfully deleted' in browser.contents
     
    227227Let's enter the contact form::
    228228
    229   >>> browser.open('http://localhost/myinstitution/contactadmin')
     229  >>> browser.open('http://localhost/mycompany/contactadmin')
    230230  >>> print browser.contents
    231231  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    236236contact@waeup.org)::
    237237
    238   >>> browser.open('http://localhost/myinstitution/contactadmin')
     238  >>> browser.open('http://localhost/mycompany/contactadmin')
    239239  >>> browser.getControl(name='form.body').value = "test message"
    240240  >>> browser.getControl('Send').click()
     
    253253The data center helps us uploading files for later import or similar.
    254254
    255   >>> browser.open('http://localhost/myinstitution')
     255  >>> browser.open('http://localhost/mycompany')
    256256  >>> browser.getLink('Data Center').click()
    257257
Note: See TracChangeset for help on using the changeset viewer.