Index: main/waeup.sirp/trunk/src/waeup/sirp/students/accommodation.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/accommodation.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/accommodation.py	(revision 7256)
@@ -21,6 +21,6 @@
 from datetime import datetime
 import grok
-from grok import index
 from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
 from waeup.sirp.interfaces import academic_sessions_vocab
 from waeup.sirp.students.interfaces import (
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py	(revision 7256)
@@ -26,5 +26,4 @@
 import grok
 import csv
-import copy
 from zope.interface import Interface
 from zope.schema import getFields
@@ -34,5 +33,5 @@
     IBatchProcessor, FatalCSVError, IObjectConverter)
 from waeup.sirp.students.interfaces import (
-    IStudent, IStudentStudyCourse, IStudentStudyCourseImport,
+    IStudent, IStudentStudyCourseImport,
     IStudentUpdateByRegNo, IStudentUpdateByMatricNo)
 from waeup.sirp.utils.batching import BatchProcessor
@@ -57,5 +56,4 @@
     @property
     def available_fields(self):
-        result = []
         return sorted(list(set(
             ['student_id','reg_number','matric_number'] + getFields(
@@ -187,5 +185,4 @@
     @property
     def available_fields(self):
-        result = []
         return sorted(list(set(
             ['student_id','reg_number','matric_number'] + getFields(
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7256)
@@ -21,5 +21,5 @@
 import grok
 from time import time
-from datetime import date, datetime
+from datetime import datetime
 from zope.event import notify
 from zope.catalog.interfaces import ICatalog
@@ -58,5 +58,5 @@
 from waeup.sirp.authentication import get_principal_role_manager
 from waeup.sirp.hostels.hostel import NOT_OCCUPIED
-from waeup.sirp.utils.helpers import get_user_account, send_mail
+from waeup.sirp.utils.helpers import send_mail
 
 def write_log_message(view, message):
@@ -67,5 +67,4 @@
 # Save function used for save methods in pages
 def msave(view, **data):
-    form = view.request.form
     changed_fields = view.applyData(view.context, **data)
     # Turn list of lists into single list
@@ -1998,5 +1997,4 @@
     @grok.action('Register course list')
     def RegisterCourses(self, **data):
-        state = IWorkflowState(self.context.getStudent()).getState()
         IWorkflowInfo(self.context.getStudent()).fireTransition('register_courses')
         self.flash('Course list has been registered.')
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/container.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/container.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/container.py	(revision 7256)
@@ -20,5 +20,4 @@
 """
 import grok
-import os
 from waeup.sirp.students.interfaces import (
     IStudentsContainer, IStudent)
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/dynamicroles.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/dynamicroles.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/dynamicroles.py	(revision 7256)
@@ -23,10 +23,8 @@
 """
 import grok
-from zope.securitypolicy.interfaces import (
-    IPrincipalRoleManager, IPrincipalPermissionManager,)
-from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager
+from zope.securitypolicy.interfaces import IPrincipalRoleManager
 from zope.securitypolicy.principalpermission import (
     AnnotationPrincipalPermissionManager,)
-from zope.securitypolicy.settings import Allow, Deny, Unset
+from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager
 from waeup.sirp.students.interfaces import IStudent
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py	(revision 7256)
@@ -17,6 +17,5 @@
 ##
 from datetime import datetime
-from zope.interface import Attribute, invariant, Interface
-from zope.interface.exceptions import Invalid
+from zope.interface import Attribute, Interface
 from zope import schema
 from waeup.sirp.interfaces import (
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/payments.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/payments.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/payments.py	(revision 7256)
@@ -20,5 +20,4 @@
 """
 import grok
-from grok import index
 from zope.component.interfaces import IFactory
 from zope.interface import implementedBy
@@ -51,5 +50,4 @@
     def __init__(self):
         super(StudentOnlinePayment, self).__init__()
-        p_id = None
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/student.py	(revision 7256)
@@ -21,5 +21,4 @@
 import os
 import grok
-from grok import index
 from zope.component.interfaces import IFactory
 from zope.interface import implementedBy
@@ -253,5 +252,4 @@
         """Create a browsable file-like object.
         """
-        ext = os.path.splitext(filename)[1].lower()
         # call super method to ensure that any old files with
         # different filename extension are deleted.
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py	(revision 7256)
@@ -21,7 +21,6 @@
 """
 import grok
-from grok import index
 from zope.component.interfaces import IFactory
-from zope.securitypolicy.interfaces import IPrincipalRoleManager
+from zope.interface import implementedBy
 from waeup.sirp.students.interfaces import (
     IStudentStudyCourse, IStudentNavigation, IStudentStudyLevel)
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/studylevel.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/studylevel.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/studylevel.py	(revision 7256)
@@ -21,6 +21,4 @@
 """
 import grok
-from grok import index
-from zope.component.interfaces import IFactory
 from waeup.sirp.students.interfaces import (
     IStudentStudyLevel, IStudentNavigation, ICourseTicket)
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py	(revision 7256)
@@ -32,5 +32,4 @@
     StudentProcessor, StudentStudyCourseProcessor)
 from waeup.sirp.students.student import Student
-from waeup.sirp.students.studycourse import StudentStudyCourse
 from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase
 from waeup.sirp.interfaces import IBatchProcessor
@@ -151,9 +150,4 @@
 
     def test_delEntry(self):
-        self.importer.delEntry(
-            dict(student_id=self.student.student_id), self.app)
-        assert self.student.student_id not in self.app['students'].keys()
-
-    def test_delEntry(self):
         assert self.student.student_id in self.app['students'].keys()
         self.importer.delEntry(
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_container.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_container.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_container.py	(revision 7256)
@@ -19,9 +19,7 @@
 Tests for students containers.
 """
-import unittest
 import tempfile
 import shutil
 from zope.interface.verify import verifyClass, verifyObject
-from zope.component.interfaces import IFactory
 from zope.component.hooks import setSite, clearSite
 from waeup.sirp.app import University
@@ -34,6 +32,5 @@
     )
 from waeup.sirp.testing import (
-    FunctionalLayer, FunctionalTestCase, get_all_loggers, remove_new_loggers,
-    remove_logger)
+    FunctionalLayer, FunctionalTestCase, remove_logger)
 
 class StudentsContainerTestCase(FunctionalTestCase):
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 7255)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 7256)
@@ -20,5 +20,5 @@
 import grok
 from random import SystemRandom as r
-from datetime import date, datetime
+from datetime import datetime
 from reportlab.pdfgen import canvas
 from reportlab.lib.units import cm
@@ -29,5 +29,4 @@
 from reportlab.platypus.tables import TableStyle
 from zope.formlib.form import setUpEditWidgets
-from waeup.sirp.interfaces import academic_sessions_vocab
 from waeup.sirp.students.interfaces import IStudentsUtils
 
@@ -112,5 +111,4 @@
         d['booking_session'] = site_confoguration.accommodation_session
         d['allowed_states'] = site_confoguration.accommodation_states
-        session = str(d['booking_session'])
         # Determine bed type
         studycourse = student['studycourse']
