Changeset 3758

Show
Ignore:
Timestamp:
11/25/07 12:28:51 (8 months ago)
Author:
faide
Message:

Thanks to Gregor Horvath for this suggestion. Fixes ticket #1586.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/CHANGELOG.txt

    r3756 r3758  
    33 
    44 
    5 1.0.4
     51.0.4b3
    66---------------------------- 
    77 
     
    6161* Fix pagination of out of bound pages (#1617). 
    6262* ``tg-admin i18n`` now supports Unicode strings in Kid templates (#1397). 
     63* Fixed testutil to properly use the soClasses attribute in the model 
     64  in order to pick up only the classes defined in this list and not 
     65  the rest. Thanks to Gregor Horvath for this suggestion. (#1586). 
    6366 
    6467Project Updates 
  • branches/1.0/turbogears/testutil.py

    r3617 r3758  
    160160    model = None 
    161161 
     162    def _get_soClasses(self): 
     163        try: 
     164            return [self.model.__dict__[x] for x in self.model.soClasses] 
     165 
     166        except AttributeError: 
     167            return self.model.__dict__.values() 
     168 
    162169    def setUp(self): 
    163170        if not self.model: 
     
    166173                raise "Unable to run database tests without a model" 
    167174 
    168         for item in self.model.__dict__.values(): 
     175        for item in self._get_soClasses(): 
    169176            if isinstance(item, types.TypeType) and issubclass(item, 
    170177                sqlobject.SQLObject) and item != sqlobject.SQLObject \ 
     
    174181    def tearDown(self): 
    175182        database.rollback_all() 
    176         for item in self.model.__dict__.values(): 
     183        for item in self._get_soClasses(): 
    177184            if isinstance(item, types.TypeType) and issubclass(item, 
    178185                sqlobject.SQLObject) and item != sqlobject.SQLObject \