diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-28 11:28:27 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-28 11:28:27 -0500 |
| commit | ac5d11afb3fa601d3194bbe8c087c568608985fa (patch) | |
| tree | 230a130be30174e68b7cc985fe210a223512e82b | |
| parent | 59a177a4c0bd69863e011e0f1c40e5b87fff99d3 (diff) | |
| download | sqlalchemy-ac5d11afb3fa601d3194bbe8c087c568608985fa.tar.gz | |
- push polymorphic_on not recognized warning to an exception, [ticket:1875]
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 2 | ||||
| -rw-r--r-- | test/orm/inheritance/test_basic.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 0721f7376..be7909a05 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -606,7 +606,7 @@ class Mapper(object): if self.with_polymorphic is None \ or self.with_polymorphic[1].corresponding_column(col) \ is None: - util.warn("Could not map polymorphic_on column " + raise sa_exc.InvalidRequestError("Could not map polymorphic_on column " "'%s' to the mapped table - polymorphic " "loads will not function properly" % col.description) diff --git a/test/orm/inheritance/test_basic.py b/test/orm/inheritance/test_basic.py index e7461842f..c57f1d095 100644 --- a/test/orm/inheritance/test_basic.py +++ b/test/orm/inheritance/test_basic.py @@ -97,7 +97,7 @@ class PolymorphicOnNotLocalTest(_base.MappedTest): polymorphic_identity=0) assert_raises_message( - sa_exc.SAWarning, + sa_exc.InvalidRequestError, "Could not map polymorphic_on column 'x' to the mapped table - " "polymorphic loads will not function properly", go @@ -121,7 +121,7 @@ class PolymorphicOnNotLocalTest(_base.MappedTest): with_polymorphic=('*', t1t2_join_2), polymorphic_identity=0) assert_raises_message( - sa_exc.SAWarning, + sa_exc.InvalidRequestError, "Could not map polymorphic_on column 'x' to the mapped table - " "polymorphic loads will not function properly", go |
