The waeup package
********************

:Test-Layer: unit

A portal software for student registration.

Prerequisites
=============

Before we can work with the environment, we have to register all the
utilities, adapters, etc. We grok the `waeup` package to do that::

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

Universities
============

``University`` objects are the base of all functionality provided by
this package.  They contain all facilities of a university.

We can easily create universities::

  >>> from waeup.app import University
  >>> u = University()
  >>> u
  <waeup.app.University object at 0x...>

Universities have a name.

  >>> u.name
  u'Sample University'

Universities are basically also containers for faculties, students and
hostels::

  >>> u.faculties
  <waeup.university.facultycontainer.FacultyContainer object at 0x...>

  >>> u['students']
  <waeup.students.studentcontainer.StudentContainer object at 0x...>

  >>> u['hostels']
  <waeup.hostel.hostelcontainer.HostelContainer object at 0x...>

We can export universities. For this we lookup an appropriate exporter
first::

  >>> from waeup.interfaces import IWAeUPExporter
  >>> exporter = IWAeUPExporter(u)
  >>> exporter
  <waeup.utils.importexport.Exporter object at 0x...>

Now we can trigger the export::

  >>> exporter.export(u)
  <cStringIO.StringO object at 0x...>

We can also get an XML representation as file. If we do not provide a
filepath, we will get an instance of `cStringIO.StringIO`, i.e. a
memory file::

  >>> from waeup.interfaces import IWAeUPXMLExporter
  >>> exporter = IWAeUPXMLExporter(u)
  >>> f = exporter.export(u)
  >>> f
  <cStringIO.StringO object at 0x...>

  >>> print f.read()
  <?xml version="1.0" encoding="UTF-8"?>
  <waeupdata>
  	<object type="waeup.app.University">
  		<attribute name="name" type="unicode">
  			Sample University
  		</attribute>
  	</object>
  </waeupdata>



Faculties
=========

Faculties are containers for departments. They are intended to be
managed by universities.

We can create faculties easily::

  >>> from waeup.university.faculty import Faculty
  >>> f = Faculty()
  >>> f
  <waeup.university.faculty.Faculty object at 0x...>

Also faculties want to be named::

  >>> f.name
  u'Unnamed Faculty'

Departments
===========

