diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-25 14:30:25 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-25 14:30:25 -0400 |
| commit | ca58fa5d9338b6dfaa56b25c5affa369188a7086 (patch) | |
| tree | ca3eafce3ec84b11fd5bc9bd5360342a581e0dfe /test/ext | |
| parent | 89a6e348032122e57238e685962d87975b6ccb65 (diff) | |
| download | sqlalchemy-ca58fa5d9338b6dfaa56b25c5affa369188a7086.tar.gz | |
- Fixed bug when the declarative ``__abstract__`` flag was not being
distinguished for when it was actually the value ``False``.
The ``__abstract__`` flag needs to acutally evaluate to a True
value at the level being tested.
fixes #3097
Diffstat (limited to 'test/ext')
| -rw-r--r-- | test/ext/declarative/test_mixin.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/ext/declarative/test_mixin.py b/test/ext/declarative/test_mixin.py index dab627596..d3c2ff982 100644 --- a/test/ext/declarative/test_mixin.py +++ b/test/ext/declarative/test_mixin.py @@ -115,7 +115,6 @@ class DeclarativeMixinTest(DeclarativeTestBase): eq_(MyModelA.__table__.c.foo.type.__class__, String) eq_(MyModelB.__table__.c.foo.type.__class__, Integer) - def test_not_allowed(self): class MyMixin: @@ -1279,3 +1278,27 @@ class DeclarativeMixinPropertyTest(DeclarativeTestBase): def test_relationship_primryjoin(self): self._test_relationship(True) + +class AbstractTest(DeclarativeTestBase): + def test_abstract_boolean(self): + + class A(Base): + __abstract__ = True + __tablename__ = 'x' + id = Column(Integer, primary_key=True) + + class B(Base): + __abstract__ = False + __tablename__ = 'y' + id = Column(Integer, primary_key=True) + + class C(Base): + __abstract__ = False + __tablename__ = 'z' + id = Column(Integer, primary_key=True) + + class D(Base): + __tablename__ = 'q' + id = Column(Integer, primary_key=True) + + eq_(set(Base.metadata.tables), set(['y', 'z', 'q'])) |
