Index: /main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py	(revision 9283)
@@ -94,4 +94,5 @@
         clearSite()
         shutil.rmtree(self.dc_root)
+        shutil.rmtree(self.workdir)
 
 class ACBatchProcessorTest(ACFullSetup):
@@ -126,5 +127,7 @@
         self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv')
         open(self.csv_file, 'wb').write(BATCH_SAMPLE_DATA)
-        self.processor.doImport(self.csv_file, BATCH_HEADER_FIELDS)
+        num, num_warns, fin_file, fail_file =  self.processor.doImport(
+            self.csv_file, BATCH_HEADER_FIELDS)
+        shutil.rmtree(os.path.dirname(fin_file))
 
         self.processor = AccessCodeProcessor()
@@ -175,5 +178,7 @@
         self.csv_file = os.path.join(self.workdir, 'sample_batch_data.csv')
         open(self.csv_file, 'wb').write(BATCH_SAMPLE_DATA)
-        self.processor.doImport(self.csv_file, BATCH_HEADER_FIELDS)
+        num, num_warns, fin_file, fail_file =  self.processor.doImport(
+            self.csv_file, BATCH_HEADER_FIELDS)
+        shutil.rmtree(os.path.dirname(fin_file))
 
         self.processor = AccessCodeProcessor()
@@ -182,4 +187,5 @@
         num, num_warns, fin_file, fail_file =  self.processor.doImport(
             self.csv_file, AC_HEADER_FIELDS)
+        shutil.rmtree(os.path.dirname(fin_file))
 
         self.assertEqual(self.app['accesscodes']['HOS-1'].used_num, 1)
@@ -192,5 +198,4 @@
         num, num_warns, fin_file, fail_file =  self.processor.doImport(
             self.csv_file, AC_HEADER_FIELDS_UPDATE, 'update')
-        fin_file = open(fin_file).read()
         self.assertEqual(num_warns,0)
         self.assertEqual(
@@ -216,3 +221,4 @@
         self.assertEqual(self.app['accesscodes']['CLR-1'].used_num, 1)
         self.assertEqual(self.app['accesscodes']['CLR-1'].disabled_num, 0)
+        shutil.rmtree(os.path.dirname(fin_file))
         return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py	(revision 9283)
@@ -434,4 +434,9 @@
         return
 
+    def tearDown(self):
+        super(ExportTests, self).tearDown()
+        clearSite()
+        shutil.rmtree(os.path.dirname(self.outfile))
+
 class HostelProcessorTest(HostelsFullSetup):
 
@@ -441,5 +446,5 @@
         self.processor = HostelProcessor()
         self.workdir = tempfile.mkdtemp()
-        self.csv_file = os.path.join(self.workdir, 'sample_student_data.csv')
+        self.csv_file = os.path.join(self.workdir, 'sample_hostel_data.csv')
         open(self.csv_file, 'wb').write(HOSTEL_SAMPLE_DATA)
         num, num_warns, fin_file, fail_file = self.processor.doImport(
@@ -462,3 +467,4 @@
             in logcontent)
         shutil.rmtree(os.path.dirname(fin_file))
-        return
+        shutil.rmtree(self.workdir)
+        return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9283)
@@ -576,5 +576,4 @@
 class StudentVerdictProcessorTest(StudentImportExportSetup):
 
-
     def setUp(self):
         super(StudentVerdictProcessorTest, self).setUp()
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9283)
@@ -1336,5 +1336,4 @@
         self.student['studycourse'].current_level = 999
         IWorkflowState(self.student).setState('school fee paid')
-        self.certificate.study_mode = 'pg_ft'
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.student_id
Index: /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py	(revision 9283)
@@ -274,5 +274,5 @@
     def test_default_handler_create_file(self):
         # we can use the default handler to store files
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         result = fs.createFile('sample.txt', StringIO('sample text'))
         self.assertEqual(result.data, 'sample.txt')
@@ -282,5 +282,5 @@
     def test_default_handler_get_file(self):
         # we can get files stored by the default handler
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         fs.createFile('sample.txt', StringIO('sample text'))
         result1 = fs.getFile('sample.txt')
@@ -292,5 +292,5 @@
     def test_customized_handler_create_file(self):
         # we can use registered filename handlers
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         result = fs.createFile(
             '__MYMARKER__sample.txt', StringIO('sample text'))
@@ -302,5 +302,5 @@
         # when we create a file of img type, the filename ext is taken
         # from input file.
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         result = fs.createFile(
             '__MYMARKER__sample_img.png', StringIO('sample text'))
@@ -312,5 +312,5 @@
         # we consider registered filename handlers when asking for
         # stored files.
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         fs.createFile('__MYMARKER__sample.txt', StringIO('sample text'))
         result1 = fs.getFile('__MYMARKER__sample.txt')
@@ -325,10 +325,10 @@
         # if we register a file name chooser, we can also get a file
         # by context and attribute
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         context = CustomContext()
         file_id1 = IFileStoreNameChooser(context).chooseName()
         file_id2 = IFileStoreNameChooser(context).chooseName(attr='img')
         file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc')
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         # create three files for a single context, each which
         # different content
@@ -365,5 +365,5 @@
     def test_delete_file(self):
         # we can remove stored files from storage
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         # First, we store a file in file store
         fs.createFile('sample.txt', StringIO('sample text'))
@@ -380,10 +380,10 @@
         # if we register a file name chooser, we can also delete a file
         # by context and attribute
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         context = CustomContext()
         file_id1 = IFileStoreNameChooser(context).chooseName()
         file_id2 = IFileStoreNameChooser(context).chooseName(attr='img')
         file_id3 = IFileStoreNameChooser(context).chooseName(attr='doc')
-        fs = ExtFileStore()
+        fs = ExtFileStore(root=self.workdir)
         # create three files for a single context, each which
         # different content
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 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py	(revision 9283)
@@ -310,4 +310,5 @@
             'code=DEP2'
             in logcontent)
+        shutil.rmtree(os.path.dirname(fin_file))
 
     def test_upload_import_reupload(self):
Index: /main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt	(revision 9283)
@@ -74,2 +74,7 @@
     >>> list(myusers)
     []
+
+Clean up:
+
+    >>> import shutil
+    >>> shutil.rmtree(workdir)
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py	(revision 9283)
@@ -392,6 +392,6 @@
 
     def __init__(self):
-        dir_path = tempfile.mkdtemp()
-        self.result = os.path.join(dir_path, 'fake.csv')
+        self.dir_path = tempfile.mkdtemp()
+        self.result = os.path.join(self.dir_path, 'fake.csv')
         open(self.result, 'wb').write('a fake result')
         return
@@ -551,3 +551,4 @@
         self.assertEqual(result2, ('4', 'cave_exporter', 'bob'))
         self.assertEqual(result3, None)
-        return
+        shutil.rmtree(fake_job.dir_path)
+        return
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py	(revision 9282)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py	(revision 9283)
@@ -194,4 +194,5 @@
         self.assertTrue('Warning 2' not in content1)
         self.assertTrue(filename1 != filename2)
+        shutil.rmtree(self.dc_root2)
         return
 
