Changeset 92

Show
Ignore:
Timestamp:
03/27/07 09:52:11 (6 years ago)
Author:
ged
Message:

I guess I really wasn't awake the day I commited r89... So now I actually
commit the fix to the inheritance unit test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/tests/test_inherit.py

    r66 r92  
    4848    def test_singletable_inheritance(self): 
    4949        homer = PersonExtended(firstname="Homer", surname="Simpson", age=36) 
    50         lisa = PersonExtended(firstname="Lisa", surname="Simpson",  
    51                               parent=homer) 
     50        # lisa needs to be a Person object, not a PersonExtended object because 
     51        # the sister relationship points to a Person, not a PersonExtendend, so 
     52        # bart's sister must be a Person. This is to comply with SQLAlchemy's 
     53        # policy to prevent loading relationships with unintended types, unless  
     54        # explicitly enabled (enable_typechecks=False). 
     55        lisa = Person(firstname="Lisa", surname="Simpson") 
    5256        bart = PersonExtended(firstname="Bart", surname="Simpson",  
    5357                              parent=homer, sister=lisa) 
     
    6064        assert p.sister.name == 'Lisa Simpson' 
    6165        assert p.parent.age == 36 
    62         # This doesn't work since the sister relation points to a Person  
    63         # object, not a PersonExtended one. 
    64 #        assert p.sister.parent == p.parent 
    6566 
    6667        for p in Person.select():