Changeset 4312


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

Update certificate tests.

File:
1 edited

Legend:

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

    r4290 r4312  
    66Creating certificates
    77=====================
     8
     9Because certificates make use of components registered with the Zope
     10Component Architecture (ZCA), we first have to grok the `waeup`
     11package. This happens automatically in real-world use:
     12
     13    >>> import grok
     14    >>> grok.testing.grok('waeup')
    815
    916We can create certificates:
     
    1522
    1623Another way to create certificates is by asking for a factory called
    17 ``waeup.Certificate``. Before we can do this, we have to grok the `waeup`
    18 package. This happens automatically in real-world use:
    19 
    20     >>> import grok
    21     >>> grok.testing.grok('waeup')
    22 
    23 Now we can create a factory without importing a class:
     24``waeup.Certificate``. This way we can create a factory without
     25importing a class:
    2426
    2527    >>> from zope.component import createObject
     
    2830    <waeup.university.certificate.Certificate object at 0x...>
    2931
     32
    3033Certificate attributes
    31 ==================
     34======================
    3235
    3336Certificates have the attributes required by the `ICertificate` interface:
     
    5962    >>> mycertificate.code
    6063    u'NA'
     64
     65`review_state`
     66--------------
     67
     68The review state can have one of the ``checking`` states defined in
     69the WAeUP workflow. These are at least the states ``checked`` and
     70``unchecked``. After a certificate is created, the review state is
     71``unchecked``:
     72
     73    >>> mycertificate.review_state
     74    'unchecked'
     75
     76We can mark a certificate as checked:
     77
     78    >>> mycertificate.check()
     79    >>> mycertificate.review_state
     80    'checked'
     81
     82We cannot uncheck a certificate:
     83
     84    >>> mycertificate.review_state = 'init'
Note: See TracChangeset for help on using the changeset viewer.