[SQL-CVS] r413 - trunk/SQLObject/tests
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2004-11-29 16:05:56
|
Author: ianb Date: 2004-11-29 16:05:52 +0000 (Mon, 29 Nov 2004) New Revision: 413 Modified: trunk/SQLObject/tests/test.py Log: ClassRegistryTest: Error string for duplicate classes changed IndexTest1: Postgres raises ProgrammingError instead of IntegrityError, sometimes; just catches either now. Modified: trunk/SQLObject/tests/test.py =================================================================== --- trunk/SQLObject/tests/test.py 2004-11-29 12:21:59 UTC (rev 412) +++ trunk/SQLObject/tests/test.py 2004-11-29 16:05:52 UTC (rev 413) @@ -34,7 +34,7 @@ class Duplicate(SQLObject): pass except ValueError, err: - self.assertEqual(str(err), "class Duplicate is already in the registry") + assert str(err).startswith("class Duplicate is already in the registry") else: self.fail("should have raised an error on duplicate class definition") @@ -1198,14 +1198,9 @@ n += 1 SOIndex1(name=name, number=n) mod = SOIndex1._connection.module - # Firebird doesn't throw an integrity error, unfortunately: - if mod.__name__.endswith('kinterbasdb'): - exc = mod.ProgrammingError - else: - exc = mod.IntegrityError try: SOIndex1(name='blah', number=0) - except exc: + except (mod.ProgrammingError, mod.IntegrityError): # expected pass else: |