Index: /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py	(revision 8997)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py	(revision 8998)
@@ -61,5 +61,5 @@
         # Populate university
         self.certificate = createObject('waeup.Certificate')
-        self.certificate.code = 'CERT1'
+        self.certificate.code = 'CRT1'
         self.app['faculties']['FAC1'] = Faculty(code='FAC1')
         self.app['faculties']['FAC1']['DEP1'] = Department(code='DEP1')
@@ -259,6 +259,4 @@
 class CourseProcessorTests(UniversityProcessorSetup):
 
-    #layer = FunctionalLayer
-
     def setUp(self):
         super(CourseProcessorTests, self).setUp()
@@ -310,54 +308,40 @@
         self.assertTrue('CRS1' in self.app['faculties']['FAC1']['DEP1'].courses.keys())
         self.proc.delEntry(self.row4, self.app)
-        self.assertTrue('CRS' not in self.app['faculties']['FAC1']['DEP1'].courses.keys())
-        return
-
-class CertificateProcessorTests(FunctionalTestCase):
-
-    layer = FunctionalLayer
+        self.assertTrue('CRS1' not in self.app['faculties']['FAC1']['DEP1'].courses.keys())
+        return
+
+class CertificateProcessorTests(UniversityProcessorSetup):
 
     def setUp(self):
         super(CertificateProcessorTests, self).setUp()
         self.proc = CertificateProcessor()
-        self.site0 = dict()
-        self.site1 = dict(faculties=dict())
-        self.site2 = dict(faculties=dict(FAC=dict()))
-        self.department1 = Department(code='DPT')
-        self.department2 = Department(code='DPT')
-        self.certificate = Certificate(code='CRT')
-        self.department2.certificates['CRT'] = self.certificate
-        self.site3 = dict(faculties=dict(FAC=dict(DPT=self.department1)))
-        self.site4 = dict(faculties=dict(FAC=dict(DPT=self.department2)))
-        self.row = dict(department_code='DPT', faculty_code='FAC', code="CRT")
+        self.row1 = dict(department_code='DEP2', faculty_code='FAC1', code="CRT1")
+        self.row2 = dict(department_code='DEP1', faculty_code='FAC2', code="CRT1")
+        self.row3 = dict(department_code='DEP1', faculty_code='FAC1', code="CRT2")
+        self.row4 = dict(department_code='DEP1', faculty_code='FAC1', code="CRT1")
         return
 
     def test_ifaces(self):
         # Make sure we fullfill all interface contracts
-        verifyClass(IBatchProcessor, CertificateProcessor)
+        verifyClass(IBatchProcessor, CourseProcessor)
         verifyObject(IBatchProcessor, self.proc)
         return
 
     def test_parents_exist(self):
-        # make sure we can find all certificate parents
-        result0 = self.proc.parentsExist(self.row, self.site0)
-        result1 = self.proc.parentsExist(self.row, self.site1)
-        result2 = self.proc.parentsExist(self.row, self.site2)
-        result3 = self.proc.parentsExist(self.row, self.site3)
-        result4 = self.proc.parentsExist(self.row, self.site4)
-        self.assertTrue(result0 is False)
+        # make sure we lookup parents correctly
+        result1 = self.proc.parentsExist(self.row1, self.app)
+        result2 = self.proc.parentsExist(self.row2, self.app)
+        result3 = self.proc.parentsExist(self.row3, self.app)
         self.assertTrue(result1 is False)
         self.assertTrue(result2 is False)
         self.assertTrue(result3 is True)
-        self.assertTrue(result4 is True)
         return
 
     def test_entry_exists(self):
         # make sure we find an entry if it exists
-        result0 = self.proc.entryExists(self.row, self.site0)
-        result1 = self.proc.entryExists(self.row, self.site1)
-        result2 = self.proc.entryExists(self.row, self.site2)
-        result3 = self.proc.entryExists(self.row, self.site3)
-        result4 = self.proc.entryExists(self.row, self.site4)
-        self.assertTrue(result0 is False)
+        result1 = self.proc.entryExists(self.row1, self.app)
+        result2 = self.proc.entryExists(self.row2, self.app)
+        result3 = self.proc.entryExists(self.row3, self.app)
+        result4 = self.proc.entryExists(self.row4, self.app)
         self.assertTrue(result1 is False)
         self.assertTrue(result2 is False)
@@ -368,6 +352,6 @@
     def test_get_entry(self):
         # make sure we can get an entry if it exists
-        result1 = self.proc.getEntry(self.row, self.site3)
-        result2 = self.proc.getEntry(self.row, self.site4)
+        result1 = self.proc.getEntry(self.row1, self.app)
+        result2 = self.proc.getEntry(self.row4, self.app)
         self.assertTrue(result1 is None)
         self.assertTrue(result2 is self.certificate)
@@ -376,8 +360,9 @@
     def test_del_entry(self):
         # make sure we can delete entries
-        self.assertTrue('CRT' in self.department2.certificates.keys())
-        self.proc.delEntry(self.row, self.site4)
-        self.assertTrue('CRT' not in self.department2.certificates.keys())
-        return
+        self.assertTrue('CRT1' in self.app['faculties']['FAC1']['DEP1'].certificates.keys())
+        self.proc.delEntry(self.row4, self.app)
+        self.assertTrue('CRT1' not in self.app['faculties']['FAC1']['DEP1'].certificates.keys())
+        return
+
 
 class CertCourseProcessorTests(FunctionalTestCase):
