[CalendarServer-changes] [6004] CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore /test/test_postgres.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 6 15:42:34 PDT 2010


Revision: 6004
          http://trac.macosforge.org/projects/calendarserver/changeset/6004
Author:   glyph at apple.com
Date:     2010-08-06 15:42:34 -0700 (Fri, 06 Aug 2010)
Log Message:
-----------
clear AB tables as well

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py	2010-08-06 22:41:47 UTC (rev 6003)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/test/test_postgres.py	2010-08-06 22:42:34 UTC (rev 6004)
@@ -123,12 +123,21 @@
             "%s schema-cleanup" % (testCase.id(),)
         )
         cursor = cleanupConn.cursor()
-        cursor.execute("delete from RESOURCE_PROPERTY")
-        cursor.execute("delete from ATTACHMENT")
-        cursor.execute("delete from CALENDAR_OBJECT")
-        cursor.execute("delete from CALENDAR_BIND")
-        cursor.execute("delete from CALENDAR")
-        cursor.execute("delete from CALENDAR_HOME")
+        tables = ['RESOURCE_PROPERTY',
+                  'ATTACHMENT',
+                  'ADDRESSBOOK_OBJECT',
+                  'CALENDAR_OBJECT',
+                  'CALENDAR_BIND',
+                  'ADDRESSBOOK_BIND',
+                  'CALENDAR',
+                  'ADDRESSBOOK',
+                  'CALENDAR_HOME',
+                  'ADDRESSBOOK_HOME']
+        for table in tables:
+            try:
+                cursor.execute("delete from "+table)
+            except:
+                log.err()
         cleanupConn.commit()
         cleanupConn.close()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100806/cf9d0145/attachment-0001.html>


More information about the calendarserver-changes mailing list