Ticket #1674 (closed defect: fixed)
[PATCH] In teardown function in testutil.py, we should destroy dependent tables first
| Reported by: | mw44118 | Owned by: | faide |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.4 |
| Component: | TurboGears | Version: | 1.0.4b3 |
| Severity: | normal | Keywords: | testutil soClasses |
| Cc: |
Description
Right now, the teardown function in testutil.py uses the optional soClasses list. I think it should go through it backwards, so that it destroys the dependent tables first.
This diff shows my suggested change:
[matt@coleridge: 0.08] ~/svn-checkouts/turbogears/turbogears
$ svn diff --diff-cmd=/usr/bin/diff testutil.py
Index: testutil.py
===================================================================
--- testutil.py (revision 3870)
+++ testutil.py (working copy)
@@ -180,7 +180,7 @@
def tearDown(self):
database.rollback_all()
- for item in self._get_soClasses():
+ for item in reversed(self._get_soClasses()):
if isinstance(item, types.TypeType) and issubclass(item,
sqlobject.SQLObject) and item != sqlobject.SQLObject \
and item != InheritableSQLObject:
Attachments
Change History
comment:1 Changed 4 years ago by mw44118
- Summary changed from In teardown function in testutil.py, we shoud destroy dependent tables first to [PATCH] In teardown function in testutil.py, we should destroy dependent tables first
comment:2 Changed 4 years ago by faide
- Status changed from new to assigned
- Owner changed from anonymous to faide
Note: See
TracTickets for help on using
tickets.

diff showing my fix