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 11 years ago

Last modified 10 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
Cc:

Description

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 @@
 
 *Fixes*
 
+* 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 11 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 11 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.