]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- push polymorphic_on not recognized warning to an exception, [ticket:1875]
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Nov 2010 16:28:27 +0000 (11:28 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Nov 2010 16:28:27 +0000 (11:28 -0500)
lib/sqlalchemy/orm/mapper.py
test/orm/inheritance/test_basic.py

index 0721f7376ed56c0be5e476d72be320f011bbcdf8..be7909a05a3e5db3151ebd76372de783e428923a 100644 (file)
@@ -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)
index e7461842f59054eb1358e75388136fed5d98d082..c57f1d095f89b362a58946cf24382835941b544e 100644 (file)
@@ -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