Changeset 152 for elixir/branches/autodelay/tests/test_autoload.py
- Timestamp:
- 07/24/07 16:51:42 (6 years ago)
- Files:
-
- 1 modified
-
elixir/branches/autodelay/tests/test_autoload.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/branches/autodelay/tests/test_autoload.py
r128 r152 42 42 global Person, Animal, Category 43 43 44 #TODO: split these into individual classes for each test. It's best to wait 45 # till we can define several classes in a method with reference between them 46 # without having to make them global. 44 47 class Person(Entity): 45 48 belongs_to('father', of_kind='Person') … … 55 58 tablename='person_person', 56 59 local_side='person_id2') 57 58 def __str__(self):59 s = '%s\n' % self.name.encode('utf-8')60 for pet in self.pets:61 s += ' * pet: %s\n' % pet.name62 return s63 64 60 65 61 class Animal(Entity): … … 77 73 metadata.connect(engine) 78 74 setup_all() 75 79 76 80 77 def teardown(): … … 102 99 homer = Person.get_by(name="Homer") 103 100 lisa = Person.get_by(name="Lisa") 101 slh = Animal.get_by(name="Santa's Little Helper") 104 102 105 print homer106 107 103 assert len(homer.animals) == 2 108 104 assert homer == lisa.pets[0].feeder
