Ignore:
Timestamp:
26 Oct 2012, 17:55:56 (12 years ago)
Author:
Henrik Bettermann
Message:

Extend StudentImportExportSetup? for BedTicket? exporter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r9421 r9426  
    4040from waeup.kofa.students.student import Student
    4141from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket
     42from waeup.kofa.students.accommodation import BedTicket
    4243from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    4344from waeup.kofa.university.faculty import Faculty
    4445from waeup.kofa.university.department import Department
     46from waeup.kofa.hostels.hostel import Hostel, Bed, NOT_OCCUPIED
    4547
    4648
     
    162164        self.app['faculties']['fac1']['dep1'].certificates.addCertificate(
    163165            self.certificate)
     166
     167        # Create a hostel with two beds
     168        hostel = Hostel()
     169        hostel.hostel_id = u'hall-1'
     170        hostel.hostel_name = u'Hall 1'
     171        self.app['hostels'].addHostel(hostel)
     172        bed = Bed()
     173        bed.bed_id = u'hall-1_A_101_A'
     174        bed.bed_number = 1
     175        bed.owner = NOT_OCCUPIED
     176        bed.bed_type = u'regular_male_fr'
     177        self.app['hostels'][hostel.hostel_id].addBed(bed)
     178        bed = Bed()
     179        bed.bed_id = u'hall-1_A_101_B'
     180        bed.bed_number = 2
     181        bed.owner = NOT_OCCUPIED
     182        bed.bed_type = u'regular_female_fr'
     183        self.app['hostels'][hostel.hostel_id].addBed(bed)
    164184
    165185        self.logfile = os.path.join(
     
    223243        ticket.semester = 2
    224244        study_level[ticket.code] = ticket
     245
     246        bedticket = BedTicket()
     247        bedticket.booking_session = 2004
     248        bedticket.bed_type = u'any bed type'
     249        bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
     250        student['accommodation'].addBedTicket(bedticket)
     251
    225252        self.add_payment(student)
    226253        return student
Note: See TracChangeset for help on using the changeset viewer.