Mercurial > p > roundup > code
diff test/db_test_base.py @ 6365:7f00fc5958ca
Make memorydb persistent across re-open
This allows memorydb to be used for more tests, in particular re-opening
with another user for checking permissions.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Wed, 31 Mar 2021 12:49:28 +0200 |
| parents | 0db59cc2cd37 |
| children | f2c31f5ec50b |
line wrap: on
line diff
--- a/test/db_test_base.py Tue Mar 30 21:04:53 2021 -0400 +++ b/test/db_test_base.py Wed Mar 31 12:49:28 2021 +0200 @@ -1379,15 +1379,13 @@ self.assertEqual(result [4][4], jp3) self.db.close() # Verify that normal user doesn't see obsolete props/classes - # Backend memorydb cannot re-open db for different user - if self.db.dbtype != 'memorydb': - self.open_database('mary') - setupSchema(self.db, 0, self.module) - # allow mary to see issue fields like title - self.db.security.addPermissionToRole('User', 'View', 'issue') - result=self.db.issue.history(id) - self.assertEqual(len(result), 2) - self.assertEqual(result [1][4], jp0) + self.open_database('mary') + setupSchema(self.db, 0, self.module) + # allow mary to see issue fields like title + self.db.security.addPermissionToRole('User', 'View', 'issue') + result=self.db.issue.history(id) + self.assertEqual(len(result), 2) + self.assertEqual(result [1][4], jp0) def testJournalPreCommit(self): id = self.db.user.create(username="mary")
