Changeset 7077 for main


Ignore:
Timestamp:
11 Nov 2011, 09:02:15 (13 years ago)
Author:
Henrik Bettermann
Message:

Further increase overall test coverage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py

    r7070 r7077  
    3636from waeup.sirp.students.student import Student
    3737from waeup.sirp.students.accommodation import BedTicket
     38from waeup.sirp.university.department import Department
    3839
    3940class HostelsContainerTestCase(FunctionalTestCase):
     
    7273        # We cannot call the fundamental methods of a base in that case
    7374        container = HostelsContainer()
     75        hostel = Hostel()
    7476        self.assertRaises(
    7577            NotImplementedError, container.archive)
    7678        self.assertRaises(
    7779            NotImplementedError, container.clear)
     80        # We cannot add arbitrary objects
     81        department = Department()
     82        self.assertRaises(
     83            TypeError, container.addHostel, department)
     84        self.assertRaises(
     85            TypeError, hostel.addBed, department)
    7886
    7987class HostelsFullSetup(FunctionalTestCase):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/container.py

    r6906 r7077  
    5353        """
    5454        user = get_current_principal()
    55         if user is None:
    56             user = 'system'
    57         else:
    58             user = user.id
     55        user = user.id
    5956        self.logger.info('%s - %s - %s - %s' % (
    6057                user, ob_class, target, comment))
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_container.py

    r6659 r7077  
    2424from zope.component.hooks import setSite, clearSite
    2525from waeup.sirp.app import University
     26from waeup.sirp.university.department import Department
    2627from waeup.sirp.students.interfaces import (
    2728    IStudentsContainer,
     
    7677        self.assertRaises(
    7778            NotImplementedError, container.clear)
     79        # We cannot add arbitrary objects
     80        department = Department()
     81        self.assertRaises(
     82            TypeError, container.addStudent, department)
     83
    7884
    7985    def test_logger(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_student.py

    r6989 r7077  
    2727    IStudentStudyLevel, ICourseTicket, IBedTicket)
    2828from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase
     29from waeup.sirp.university.department import Department
    2930
    3031class StudentTest(FunctionalTestCase):
     
    6263        return
    6364
     65    def test_base(self):
     66        department = Department()
     67        studycourse = StudentStudyCourse()
     68        self.assertRaises(
     69            TypeError, studycourse.addStudentStudyLevel, department)
     70        studylevel = StudentStudyLevel()
     71        self.assertRaises(
     72            TypeError, studylevel.addCourseTicket, department)
     73
    6474class StudentFactoryTest(FunctionalTestCase):
    6575
Note: See TracChangeset for help on using the changeset viewer.