Mercurial > p > roundup > code
comparison test/test_postgresql.py @ 5310:efb34cbdba7c
Add (currently failing) test for atomic actions
Actions via the web-interface can have several database-modifying
instructions. These should be atomic, i.e., either all should go in or
none. This is currently not the case due to commit calls from OTK
handling (CSRF-protection).
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 06 Nov 2017 09:26:59 +0100 |
| parents | 198b6e810c67 |
| children | 62de601bdf6f |
comparison
equal
deleted
inserted
replaced
| 5309:20084e2b48c3 | 5310:efb34cbdba7c |
|---|---|
| 21 from roundup.hyperdb import DatabaseError | 21 from roundup.hyperdb import DatabaseError |
| 22 from roundup.backends import get_backend, have_backend | 22 from roundup.backends import get_backend, have_backend |
| 23 | 23 |
| 24 from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest | 24 from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest |
| 25 from db_test_base import ConcurrentDBTest, HTMLItemTest, FilterCacheTest | 25 from db_test_base import ConcurrentDBTest, HTMLItemTest, FilterCacheTest |
| 26 from db_test_base import ClassicInitBase, setupTracker | 26 from db_test_base import ClassicInitBase, setupTracker, SpecialActionTest |
| 27 | 27 |
| 28 if not have_backend('postgresql'): | 28 if not have_backend('postgresql'): |
| 29 # FIX: workaround for a bug in pytest.mark.skip(): | 29 # FIX: workaround for a bug in pytest.mark.skip(): |
| 30 # https://github.com/pytest-dev/pytest/issues/568 | 30 # https://github.com/pytest-dev/pytest/issues/568 |
| 31 from .pytest_patcher import mark_class | 31 from .pytest_patcher import mark_class |
| 211 RDBMSTest.setUp(self) | 211 RDBMSTest.setUp(self) |
| 212 def tearDown(self): | 212 def tearDown(self): |
| 213 RDBMSTest.tearDown(self) | 213 RDBMSTest.tearDown(self) |
| 214 postgresqlOpener.tearDown(self) | 214 postgresqlOpener.tearDown(self) |
| 215 | 215 |
| 216 @skip_postgresql | |
| 217 class postgresqlSpecialActionTestCase(postgresqlOpener, SpecialActionTest, | |
| 218 unittest.TestCase): | |
| 219 backend = 'postgresql' | |
| 220 def setUp(self): | |
| 221 postgresqlOpener.setUp(self) | |
| 222 SpecialActionTest.setUp(self) | |
| 223 | |
| 224 def tearDown(self): | |
| 225 SpecialActionTest.tearDown(self) | |
| 226 postgresqlOpener.tearDown(self) | |
| 227 | |
| 216 # vim: set et sts=4 sw=4 : | 228 # vim: set et sts=4 sw=4 : |
