Changeset 1561


Ignore:
Timestamp:
16 Mar 2007, 03:45:15 (18 years ago)
Author:
uli
Message:

Fixed broken accomodation initialization. Updated portal_accomodation tests.

Location:
WAeUP_SRP/branches/uli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/uli/profiles/default/accommodation.xml

    r1410 r1561  
    11<?xml version="1.0"?>
    22<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
    3 <object name="portal_catalog" meta_type="WAeUP Table">
     3<object name="portal_catalog" meta_type="CMF Catalog">
    44 <column value="bed"/>
    55 <column value="bed_type"/>
  • WAeUP_SRP/branches/uli/tests/test_tables.py

    r404 r1561  
    2424   
    2525    # Test that data does not go away on reinstall
    26     def test_install(self):
     26    def test_accomodation_install(self):
    2727        # Make sure the table got installed properly
    2828        patool = self.portal.portal_accommodation
    2929        self.failUnlessEqual(patool.meta_type, 'WAeUP Accommodation Tool')
    30         self.failUnlessEqual(patool.schema(), ['bed', 'student'])
    31         self.failUnlessEqual(patool.indexes(), ['bed', 'student'])
     30        schemalist = patool.schema()
     31        schemalist.sort()
     32        self.failUnlessEqual(schemalist, ['bed', 'bed_type', 'hall', 'student'])
     33        indexeslist = patool.indexes()
     34        indexeslist.sort()
     35        self.failUnlessEqual(indexeslist, ['bed', 'bed_type', 'hall', 'student'])
    3236       
    33     def test_add_change_delete(self):
     37    def test_accomodation_add_change_delete(self):
    3438        patool = self.portal.portal_accommodation
    3539       
    3640        # Add
    37         uid = patool.addRecord(bed='bed', student='student')
     41        uid = patool.addRecord(bed='bed', bed_type='fresh', hall='hall', student='student')
    3842        result = patool.searchResults({'bed':'bed'})
    3943        self.failUnlessEqual(len(result), 1)
     44        self.failUnlessEqual(result[0].hall, 'hall')
    4045        self.failUnlessEqual(result[0].student, 'student')
     46        self.failUnlessEqual(result[0].bed, 'bed')
     47        self.failUnlessEqual(result[0].bed_type, 'fresh')
    4148       
    4249        # Change
    43         patool.modifyRecord(uid, student='newstudent')
     50        patool.modifyRecord(bed=uid, student='newstudent')
    4451        result = patool.searchResults({'bed':'bed'})
    4552        self.failUnlessEqual(len(result), 1)
Note: See TracChangeset for help on using the changeset viewer.