diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-05-26 01:00:46 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-05-26 01:00:46 +0000 |
commit | d6b9757778edea97bdbda5c98eb61b37d93296cc (patch) | |
tree | 62e328768bf514963eb40356edf45ec01d20c3b4 /test/base/except.py | |
parent | 3837a29bfc082b8e718eba007456e3a025238c1d (diff) | |
download | sqlalchemy-d6b9757778edea97bdbda5c98eb61b37d93296cc.tar.gz |
- added unit test for exception formatting
- Deprecated the hardcoded TIMESTAMP function, which when
used as func.TIMESTAMP(value) would render "TIMESTAMP value".
This breaks on some platforms as Postgres doesn't allow
bind parameters to be used in this context. The hard-coded
uppercase is also inappropriate and there's lots of other
PG casts that we'd need to support. So instead, use
text constructs i.e. select(["timestamp '12/05/09'"]).
Diffstat (limited to 'test/base/except.py')
-rw-r--r-- | test/base/except.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/base/except.py b/test/base/except.py index 457137c4c..c2b60f32a 100644 --- a/test/base/except.py +++ b/test/base/except.py @@ -25,7 +25,14 @@ class WrapTest(unittest.TestCase): '', [], OperationalError()) except sa_exceptions.DBAPIError: self.assert_(True) - + + def test_tostring(self): + try: + raise sa_exceptions.DBAPIError.instance( + 'this is a message', None, OperationalError()) + except sa_exceptions.DBAPIError, exc: + assert str(exc) == "(OperationalError) 'this is a message' None" + def test_db_error_busted_dbapi(self): try: raise sa_exceptions.DBAPIError.instance( |