if tgt is not None:
tgt.dispatch._listen(tgt, identifier, fn, *args, **kw)
return
- raise exc.InvalidRequestError("No such event %s for target %s" %
+ raise exc.InvalidRequestError("No such event '%s' for target '%s'" %
(identifier,target))
def remove(target, identifier, fn):
assert_raises(sa.exc.ArgumentError,
relationship, Address, cascade="fake, all, delete-orphan")
+ @testing.resolve_artifact_names
+ def test_friendly_attribute_str_on_uncompiled_boom(self):
+ def boom():
+ raise Exception("it broke")
+ mapper(User, users, properties={
+ 'addresses':relationship(boom)
+ })
+
+ # test that QueryableAttribute.__str__() doesn't
+ # cause a compile.
+ eq_(str(User.addresses), "User.addresses")
+
@testing.resolve_artifact_names
def test_exceptions_sticky(self):
"""test preservation of mapper compile errors raised during hasattr(),