Changeset 245
- Timestamp:
- 10/26/07 12:01:04 (6 years ago)
- Location:
- elixir/trunk/tests
- Files:
-
- 12 modified
-
test_autoload_nopk.py (modified) (1 diff)
-
test_autosetup.py (modified) (5 diffs)
-
test_encryption.py (modified) (2 diffs)
-
test_events.py (modified) (1 diff)
-
test_m2m.py (modified) (1 diff)
-
test_nestedclass.py (modified) (2 diffs)
-
test_o2m.py (modified) (1 diff)
-
test_options.py (modified) (8 diffs)
-
test_order_by.py (modified) (1 diff)
-
test_packages.py (modified) (1 diff)
-
test_properties.py (modified) (2 diffs)
-
test_versioning.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/tests/test_autoload_nopk.py
r225 r245 28 28 using_mapper_options(primary_key=['id']) 29 29 30 setup_all() 31 30 32 barney = Person(id=1, name="Barney") 31 33 -
elixir/trunk/tests/test_autosetup.py
r234 r245 64 64 class Person(Entity): 65 65 name = Field(Unicode(30)) 66 using_options( tablename='person')66 using_options(autosetup=True, tablename='person') 67 67 68 68 assert 'person' in metadata.tables … … 73 73 class Person(Entity): 74 74 name = Field(Unicode(30)) 75 using_options( tablename='person')75 using_options(autosetup=True, tablename='person') 76 76 77 77 tablename = Person.table.name … … 82 82 class Person(Entity): 83 83 name = Field(Unicode(30)) 84 using_options( tablename='person')84 using_options(autosetup=True, tablename='person') 85 85 86 86 create_all() … … 90 90 class Person(Entity): 91 91 name = Field(Unicode(30)) 92 using_options( tablename='person')92 using_options(autosetup=True, tablename='person') 93 93 94 94 setup_all() … … 98 98 class Person(Entity): 99 99 name = Field(Unicode(30)) 100 using_options( tablename='person')100 using_options(autosetup=True, tablename='person') 101 101 102 102 q = Person.query -
elixir/trunk/tests/test_encryption.py
r234 r245 29 29 class TestEncryption(object): 30 30 def setup(self): 31 create_all()31 setup_all(True) 32 32 33 33 def teardown(self): … … 54 54 55 55 p = Person.get_by(name='Jonathan LaCour') 56 print p.password 56 57 assert p.password == 's3cr3tw0RD' 57 58 assert p.ssn == '123-45-6789' -
elixir/trunk/tests/test_events.py
r234 r245 57 57 metadata.bind = 'sqlite:///' 58 58 59 setup_all() 60 59 61 60 62 def teardown(): -
elixir/trunk/tests/test_m2m.py
r234 r245 69 69 friends = ManyToMany('Person') 70 70 71 create_all()71 setup_all(True) 72 72 73 73 barney = Person(name="Barney") -
elixir/trunk/tests/test_nestedclass.py
r234 r245 1 from elixir import Entity, Field, String1 from elixir import * 2 2 3 3 def setup(): … … 13 13 14 14 other = Field(String(40)) 15 16 setup_all() 15 17 16 18 class TestNestedClass(object): 17 19 def test_nestedclass(self): 20 18 21 print "GLOBALS", globals().keys() 19 22 assert 'name' in Thing.table.columns.keys() -
elixir/trunk/tests/test_o2m.py
r234 r245 89 89 return s 90 90 91 create_all()91 setup_all(True) 92 92 93 93 node2 = TreeNode(name='node2') -
elixir/trunk/tests/test_options.py
r234 r245 22 22 using_options(version_id_col=True) 23 23 24 setup_all() 24 25 Person.table.create() 25 26 … … 62 63 options_defaults['tablename'] = camel_to_underscore 63 64 64 setup_all(True)65 66 65 class MyEntity(Entity): 67 66 name = Field(Unicode(30)) … … 97 96 surname = Field(Unicode(30)) 98 97 98 setup_all() 99 99 create_all(engine) 100 100 … … 114 114 surname = Field(Unicode(30)) 115 115 116 setup_all() 116 117 create_all(engine) 117 118 … … 155 156 surname = Field(Unicode(30)) 156 157 158 setup_all() 157 159 create_all(engine) 158 160 … … 181 183 surname = Field(Unicode(30)) 182 184 185 setup_all() 183 186 create_all(engine) 184 187 … … 208 211 surname = Field(Unicode(30)) 209 212 213 setup_all() 210 214 create_all(engine) 211 215 … … 234 238 using_table_options(UniqueConstraint('firstname', 'surname')) 235 239 236 create_all()240 setup_all(True) 237 241 238 242 homer = Person(firstname="Homer", surname='Simpson') -
elixir/trunk/tests/test_order_by.py
r234 r245 30 30 31 31 metadata.bind = 'sqlite:///' 32 create_all()32 setup_all(True) 33 33 34 34 # insert some data -
elixir/trunk/tests/test_packages.py
r234 r245 18 18 # all modules, including a and b. Then when any other test calls 19 19 # setup_all(), A and B are also setup, but then the other test also 20 # calls cleanup_all(), so when we get here, A and B are already dead and21 # reimporting their modules does nothing because they were already20 # calls cleanup_all(), so when we get here, A and B are already dead 21 # and reimporting their modules does nothing because they were already 22 22 # imported. 23 23 sys.modules.pop('tests.a', None) -
elixir/trunk/tests/test_properties.py
r243 r245 10 10 11 11 12 class Test HasProperty(object):12 class TestSpecialProperties(object): 13 13 def teardown(self): 14 14 cleanup_all() … … 36 36 has_many('tags', of_kind='Tag', lazy=False) 37 37 38 create_all()38 setup_all(True) 39 39 40 40 u1 = User(name='joe', tags=[Tag(score1=5.0, score2=3.0), -
elixir/trunk/tests/test_versioning.py
r234 r245 32 32 using_options(tablename='actors') 33 33 34 setup_all() 34 35 metadata.bind = 'sqlite:///' 35 36
