diff test/test_postgresql.py @ 4448:2784c239e6c8

clear the cache on commit for rdbms backends: Don't carry over cached values from one transaction to the next (there may be other changes from other transactions) see new ConcurrentDBTest for a read-modify-update cycle that fails with the old caching behavior.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Fri, 22 Oct 2010 14:14:26 +0000
parents 4d9adb8bc3b1
children 34dce76bb202
line wrap: on
line diff
--- a/test/test_postgresql.py	Thu Oct 21 20:31:13 2010 +0000
+++ b/test/test_postgresql.py	Fri Oct 22 14:14:26 2010 +0000
@@ -22,6 +22,7 @@
 from roundup.hyperdb import DatabaseError
 
 from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest
+from db_test_base import ConcurrentDBTest
 
 from roundup.backends import get_backend, have_backend
 
@@ -57,6 +58,16 @@
         ROTest.tearDown(self)
         postgresqlOpener.tearDown(self)
 
+class postgresqlConcurrencyTest(postgresqlOpener, ConcurrentDBTest):
+    backend = 'postgresql'
+    def setUp(self):
+        postgresqlOpener.setUp(self)
+        ConcurrentDBTest.setUp(self)
+
+    def tearDown(self):
+        ConcurrentDBTest.tearDown(self)
+        postgresqlOpener.tearDown(self)
+
 class postgresqlSchemaTest(postgresqlOpener, SchemaTest):
     def setUp(self):
         postgresqlOpener.setUp(self)
@@ -102,6 +113,7 @@
     suite.addTest(unittest.makeSuite(postgresqlSchemaTest))
     suite.addTest(unittest.makeSuite(postgresqlClassicInitTest))
     suite.addTest(unittest.makeSuite(postgresqlSessionTest))
+    suite.addTest(unittest.makeSuite(postgresqlConcurrencyTest))
     return suite
 
 # vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/