Courses
*******

:Test-Layer: unit

Creating courses
================

We can create courses:

    >>> from waeup.university.course import Course
    >>> mycourse = Course()
    >>> mycourse
    <waeup.university.course.Course object at 0x...>

Another way to create courses is by asking for a factory called
``waeup.Course``. Before we can do this, we have to grok the `waeup`
package. This happens automatically in real-world use:

    >>> import grok
    >>> grok.testing.grok('waeup')

Now we can create a factory without importing a class:

    >>> from zope.component import createObject
    >>> mycourse = createObject(u'waeup.Course')
    >>> mycourse
    <waeup.university.course.Course object at 0x...>

Course attributes
==================

Courses have the attributes required by the `ICourse` interface:

    >>> from waeup.interfaces import ICourse
    >>> ICourse.providedBy(mycourse)
    True

    >>> from zope.interface.verify import verifyObject
    >>> verifyObject(ICourse, mycourse)
    True

Each of the following attributes except ``level`` is mandatory.

`title`
-------

Each course has a title:

    >>> mycourse.title
    u'Unnamed Course'

`code`
------

Each course holds a code, which might be a shortcut or abbreviation
of the real course name. By default the code is ``NA`` (=not assigned):

    >>> mycourse.code
    u'NA'

`passmark`
----------

Each course holdes a passmark, which is 40 by default:

    >>> mycourse.passmark
    40

`semester`
----------

Each course holds a semester attribute which is 1 by default:

    >>> mycourse.semester
    1

`level`
-------

Courses can have a level. This attribute is not required and the
default value is ``None``:

    >>> mycourse.level is None
    True
