Author: phd
Date: 2007-04-09 09:19:40 -0600 (Mon, 09 Apr 2007)
New Revision: 2498
Modified:
SQLObject/trunk/sqlobject/inheritance/tests/test_deep_inheritance.py
Log:
Fixed test_deep_inheritance.py - setup classes in the correct order
(required for Postgres 8.0+ which is strict about referential integrity).
Modified: SQLObject/trunk/sqlobject/inheritance/tests/test_deep_inheritance.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/tests/test_deep_inheritance.py 2007-04-09 15:19:17 UTC (rev 2497)
+++ SQLObject/trunk/sqlobject/inheritance/tests/test_deep_inheritance.py 2007-04-09 15:19:40 UTC (rev 2498)
@@ -23,12 +23,10 @@
Try to creae an Manager without specifying a position.
this should fail without leaving any partial records in
the database.
+
"""
+ setupClass([DIManager, DIEmployee, DIPerson])
- setupClass(DIManager)
- setupClass(DIEmployee)
- setupClass(DIPerson)
-
kwargs ={'firstName':'John', 'lastname':'Doe'}
raises(TypeError, DIManager, **kwargs)
#what we really need to check for is partial records in the database.
@@ -37,13 +35,8 @@
assert persons.count() == 0
def test_deep_inheritance():
+ setupClass([DIManager, DIEmployee, DIPerson])
- cache = getConnection().cache
-
- setupClass(DIManager)
- setupClass(DIEmployee)
- setupClass(DIPerson)
-
manager = DIManager(firstName='Project', lastName='Manager',
position='Project Manager')
manager_id = manager.id
@@ -51,6 +44,8 @@
position='Project leader', manager=manager).id
person_id = DIPerson(firstName='Oneof', lastName='Authors',
manager=manager).id
+
+ cache = getConnection().cache
cache.clear()
managers = list(DIManager.select())
|