root / elixir / tags / 0.7.0 / tests / test_class_methods.py
| Revision 467, 428 bytes (checked in by ged, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | """ |
| 2 | simple test case |
| 3 | """ |
| 4 | |
| 5 | from elixir import * |
| 6 | |
| 7 | #----------- |
| 8 | |
| 9 | class TestOldMethods(object): |
| 10 | def setup(self): |
| 11 | metadata.bind = 'sqlite://' |
| 12 | |
| 13 | def teardown(self): |
| 14 | cleanup_all() |
| 15 | |
| 16 | def test_get(self): |
| 17 | class A(Entity): |
| 18 | name = Field(String(32)) |
| 19 | |
| 20 | setup_all(True) |
| 21 | |
| 22 | a1 = A(name="a1") |
| 23 | |
| 24 | session.commit() |
| 25 | session.clear() |
| 26 | |
| 27 | assert A.get(1).name == "a1" |
Note: See TracBrowser
for help on using the browser.
