diff test/session_common.py @ 5319:62de601bdf6f

Fix commits although a Reject exception is raised Fix the problem that changes are committed to the database (due to commits to otk handling) even when a Reject exception occurs. The fix implements separate database connections for otk/session handling and normal database operation.
author Ralf Schlatterbeck <rsc@runtux.com>
date Fri, 20 Apr 2018 18:46:28 +0200
parents 63c79c0992ae
children d26921b851c3
line wrap: on
line diff
--- a/test/session_common.py	Thu Apr 19 20:01:43 2018 +0200
+++ b/test/session_common.py	Fri Apr 20 18:46:28 2018 +0200
@@ -10,12 +10,10 @@
             shutil.rmtree(config.DATABASE)
         os.makedirs(config.DATABASE + '/files')
         self.db = self.module.Database(config, 'admin')
-        self.sessions = self.sessions_module.Sessions(self.db)
-        self.otks = self.sessions_module.OneTimeKeys(self.db)
+        self.sessions = self.db.getSessionManager()
+        self.otks = self.db.getOTKManager()
 
     def tearDown(self):
-        del self.otks
-        del self.sessions
         if hasattr(self, 'db'):
             self.db.close()
         if os.path.exists(config.DATABASE):
@@ -50,9 +48,3 @@
         self.sessions.set('random_key', text='nope')
         self.assertEqual(self.sessions.get('random_key', 'text'), 'nope')
 
-class DBMTest(SessionTest):
-    import roundup.backends.sessions_dbm as sessions_module
-
-class RDBMSTest(SessionTest):
-    import roundup.backends.sessions_rdbms as sessions_module
-

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