Index: /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/export.py
===================================================================
--- /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/export.py	(revision 12905)
+++ /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/export.py	(revision 12905)
@@ -0,0 +1,24 @@
+## $Id$
+##
+## Copyright (C) 2015 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+from waeup.kofa.university.export import DepartmentExporter
+
+class CustomDepartmentExporter(DepartmentExporter):
+
+    fields = ('code', 'faculty_code', 'title', 'title_prefix',
+        'users_with_local_roles', 'next_matric_dict')
Index: /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/tests.py
===================================================================
--- /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/tests.py	(revision 12905)
+++ /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/university/tests.py	(revision 12905)
@@ -0,0 +1,52 @@
+## $Id$
+##
+## Copyright (C) 2015 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+import tempfile
+import os
+from zope.component import getUtility
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kwarapoly.testing import FunctionalLayer
+from waeup.kwarapoly.university.export import CustomDepartmentExporter
+
+class DepartmentExporterTest(StudentsFullSetup):
+
+    layer = FunctionalLayer
+
+    def test_export_all(self):
+        self.workdir = tempfile.mkdtemp()
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        utils = getUtility(IStudentsUtils)
+        self.student.matric_number = None
+        msg, mnumber = utils.setMatricNumber(self.student)
+        self.assertEqual(msg, 'Matriculation number cannot be set.')
+        self.assertEqual(mnumber, None)
+        self.student['studycourse'].entry_mode = 'nd_ft'
+        self.student['studycourse'].entry_session = 2013
+        msg, mnumber = utils.setMatricNumber(self.student)
+        exporter = CustomDepartmentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'code,faculty_code,title,title_prefix,users_with_local_roles,'
+            'next_matric_dict\r\n'
+            'dep1,fac1,Unnamed Department,department,[],{2013: 2}\r\n'
+            )
+        return
+
