Ignore:
Timestamp:
20 Jun 2009, 19:45:45 (15 years ago)
Author:
uli
Message:

Add tests for certificate courses.

File:
1 edited

Legend:

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

    r4317 r4322  
    1717=======================================
    1818
     19
    1920:class:`Certificate`
    2021--------------------
     
    4041     >>> verifyObject(ICertificate, mycertificate)
    4142     True
     43
     44   Beside the attributes, certificates are containers for
     45   certificate-courses (see :class:`CertificateCourse`). Each
     46   certificate course can be accessed by the code of the course it wraps.
    4247
    4348   .. attribute:: title
     
    156161          as source state (is: 'checked')
    157162
     163   .. method:: addCourseRef(course[, level=100,[ core_or_elective=True]])
     164
     165      Add a reference to a course. A course is an object implementing
     166      :class:`waeup.interfaces.ICourse`.
     167
     168      Please don't be confused by the term 'reference'. This just
     169      means an ordinary :class:`waeup.university.course.Course` object
     170      in almost all cases. As this object will normaly be one stored
     171      in a department, the course here will simply become a reference
     172      to the 'real' one in the department container.
     173
     174   .. method:: delCourseRef(code)
     175
     176      Remove a course from a certificate.
     177
     178      The course must be given by its code number.
     179
     180:class:`CertificateCourse`
     181--------------------------
     182
     183.. class:: CertificateCourse(course[, level=100[, core_or_elective=True]])
     184
     185   Create a certificate course.
     186
     187   A certificate-course is a course (:class:`Course`) which is part of
     188   a certificate. Normally, certificate-courses are held in
     189   certificates and refer to an existing :class:`Course` instance held
     190   elsewhere.
     191
     192   A certificate can require several courses and one
     193   course can be required by several certificates.
     194
     195   .. attribute:: course
     196
     197      An instance of :class:`ICourse`.
     198
     199   .. attribute:: level
     200
     201      An integer telling the level to which this course applies.
     202
     203   .. attribute:: core_or_elective
     204
     205      A bool stating whether this course is required or optional to
     206      get the certificate.
     207
     208
    158209
    159210Utilities
     
    180231========
    181232
     233Certificates
     234------------
    182235
    183236We can create certificates:
     
    197250    <waeup.university.certificate.Certificate object at 0x...>
    198251
     252CertificateCourses
     253------------------
     254
     255:class:`CertificateCourse` instances comply with the
     256:class:`ICertificateCourse` interface:
     257
     258    >>> from waeup.interfaces import ICertificateCourse
     259    >>> from waeup.university.certificate import CertificateCourse
     260    >>> mycertcourse = CertificateCourse(None, 200, False)
     261    >>> ICertificateCourse.providedBy(mycertcourse)
     262    True
     263
     264    >>> from zope.interface.verify import verifyObject
     265    >>> verifyObject(ICertificateCourse, mycertcourse)
     266    True
     267
Note: See TracChangeset for help on using the changeset viewer.