root / elixir / trunk / tests / test_nestedclass.py

Revision 452, 0.8 kB (checked in by ged, 3 years ago)

simplified some tests

Line 
1from elixir import *
2
3def setup():
4    global Thing
5
6    class Thing(Entity):
7        name = Field(String(40))
8        type = Field(String(40))
9
10        class Stuff(Entity):
11            ping = Field(String(32))
12            pong = Field(String(32))
13
14        other = Field(String(40))
15
16    setup_all()
17
18class TestNestedClass(object):
19    def test_nestedclass(self):
20        assert 'name' in Thing.table.columns
21        assert 'type' in Thing.table.columns
22        assert 'other' in Thing.table.columns
23        assert 'ping' not in Thing.table.columns
24        assert 'pong' not in Thing.table.columns
25
26        assert 'name' not in Thing.Stuff.table.columns
27        assert 'type' not in Thing.Stuff.table.columns
28        assert 'other' not in Thing.Stuff.table.columns
29        assert 'ping' in Thing.Stuff.table.columns
30        assert 'pong' in Thing.Stuff.table.columns
Note: See TracBrowser for help on using the browser.