Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_batching.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_batching.py	(revision 12257)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_batching.py	(revision 12266)
@@ -79,8 +79,18 @@
 
     def setup_for_export(self):
-        document = PDFDocument()
-        self.app['documents'][document.document_id] = self.document = document
+        document1 = PDFDocument()
+        document1.document_id = u'DOC1'
+        self.app['documents'].addDocument(document1)
+        self.pdfdocument = document1
         self.outfile = os.path.join(self.workdir, 'myoutput.csv')
-        role_manager = IPrincipalRoleManager(document)
+        role_manager = IPrincipalRoleManager(document1)
+        role_manager.assignRoleToPrincipal(u'johnsrole', u'john')
+
+        document2 = HTMLDocument()
+        document2.document_id = u'DOC2'
+        self.app['documents'].addDocument(document2)
+        self.htmldocument = document2
+        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
+        role_manager = IPrincipalRoleManager(document2)
         role_manager.assignRoleToPrincipal(u'johnsrole', u'john')
         return
Index: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_export.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_export.py	(revision 12266)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_export.py	(revision 12266)
@@ -0,0 +1,132 @@
+## $Id: test_export.py 12097 2014-11-30 20:49:22Z henrik $
+##
+## Copyright (C) 2014 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
+##
+"""
+Test the document exporter.
+"""
+import os
+import grok
+import datetime
+from cStringIO import StringIO
+from zope.component import queryUtility, getUtility
+from zope.event import notify
+from zope.interface.verify import verifyObject, verifyClass
+from waeup.ikoba.interfaces import (
+    ICSVExporter, IExtFileStore, IFileStoreNameChooser)
+from waeup.ikoba.documents.export import (
+    PDFDocumentExporter, HTMLDocumentExporter)
+from waeup.ikoba.documents.document import PDFDocument, HTMLDocument
+from waeup.ikoba.documents.tests.test_batching import DocumentImportExportSetup
+from waeup.ikoba.testing import FunctionalLayer
+
+
+class PDFDocumentExporterTest(DocumentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(PDFDocumentExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = PDFDocumentExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, PDFDocumentExporter)
+        return
+
+    def test_get_as_utility(self):
+        # we can get an document exporter as utility
+        result = queryUtility(ICSVExporter, name="pdfdocuments")
+        self.assertTrue(result is not None)
+        return
+
+    def test_export(self):
+        # we can really export a document
+        exporter = PDFDocumentExporter()
+        exporter.export([self.pdfdocument], self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'description,document_id,title,users_with_local_roles\r\n'
+            ',DOC1,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"'
+            in result
+            )
+        return
+
+    def test_export_all(self):
+        # we can really export all documents
+        exporter = PDFDocumentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'description,document_id,title,users_with_local_roles\r\n'
+            ',DOC1,,"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"'
+            in result
+            )
+        return
+
+
+class HTMLDocumentExporterTest(DocumentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(HTMLDocumentExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = HTMLDocumentExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, HTMLDocumentExporter)
+        return
+
+    def test_get_as_utility(self):
+        # we can get an document exporter as utility
+        result = queryUtility(ICSVExporter, name="htmldocuments")
+        self.assertTrue(result is not None)
+        return
+
+    def test_export(self):
+        # we can really export a document
+        exporter = HTMLDocumentExporter()
+        exporter.export([self.htmldocument], self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'description,document_id,html_multilingual,title,'
+            'users_with_local_roles\r\n,DOC2,'
+            ',,'
+            '"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
+            in result
+            )
+        return
+
+    def test_export_all(self):
+        # we can really export all documents
+        exporter = HTMLDocumentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertTrue(
+            'description,document_id,html_multilingual,title,'
+            'users_with_local_roles\r\n,DOC2,'
+            ',,'
+            '"[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
+            in result
+            )
+        return
