Changeset 92
- Timestamp:
- 03/27/07 09:52:11 (6 years ago)
- Files:
-
- 1 modified
-
elixir/trunk/tests/test_inherit.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/tests/test_inherit.py
r66 r92 48 48 def test_singletable_inheritance(self): 49 49 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") 52 56 bart = PersonExtended(firstname="Bart", surname="Simpson", 53 57 parent=homer, sister=lisa) … … 60 64 assert p.sister.name == 'Lisa Simpson' 61 65 assert p.parent.age == 36 62 # This doesn't work since the sister relation points to a Person63 # object, not a PersonExtended one.64 # assert p.sister.parent == p.parent65 66 66 67 for p in Person.select():
