Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1094 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

[PATCH] DBTest trying to drop tables that don't exist

Reported by: nerkles Owned by: anonymous
Priority: normal Milestone: 1.0b1
Component: TurboGears Version:
Severity: normal Keywords: testutil.py nose DBTest


here is a diff against the 1.0 branch (really it only changes 1 line)

Index: CHANGELOG.txt
--- CHANGELOG.txt       (revision 1815)
+++ CHANGELOG.txt       (working copy)
@@ -8,6 +8,10 @@
+* testutil's tearDown for SQLObject confirms the existence of a table
+  before attempting to drop it. This caused problems if you used an explicit
+  object for the intermediateTable in RelatedJoins.
 * Exceptions raised when SA flushes are now dispatched with TG's errorhandling.
 *Project Updates*
Index: turbogears/testutil.py
--- turbogears/testutil.py      (revision 1815)
+++ turbogears/testutil.py      (working copy)
@@ -91,7 +91,7 @@
             if inspect.isclass(item) and issubclass(item,
                 sqlobject.SQLObject) and item != sqlobject.SQLObject \
                 and item != InheritableSQLObject:
-                item.dropTable()
+                item.dropTable(ifExists=True)
 def reset_cp():
     cherrypy.root = None

Change History

comment:1 Changed 13 years ago by nerkles

  • Summary changed from patch for problem with DBTest trying to drop tables that don't exist to [PATCH] DBTest trying to drop tables that don't exist

comment:2 Changed 13 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed

committed in [1850]. Thanks!

Note: See TracTickets for help on using tickets.